src/main/java/com/github/phantomthief/util/MoreCollectors.java
@Deprecated
    public static <T, K, U, M extends Multimap<K, U>> Collector<T, ?, M> toMultimap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper, Supplier<M> supplier) {
        BiConsumer<M, T> accumulator = (multimap, element) -> multimap.put(keyMapper.apply(element),
                valueMapper.apply(element));
        BinaryOperator<M> finisher = (m1, m2) -> {
            m1.putAll(m2);
            return m1;
        };
        return new CollectorImpl<>(supplier, accumulator, finisher, CH_ID);
    }
@Deprecated
    public static <T, K, U, M extends Multimap<K, U>> Collector<T, ?, M> toMultimap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper, Supplier<M> supplier) {
        BiConsumer<M, T> accumulator = (multimap, element) -> multimap.put(keyMapper.apply(element),
                valueMapper.apply(element));
        BinaryOperator<M> finisher = (m1, m2) -> {
            m1.putAll(m2);
            return m1;
        };
        return new CollectorImpl<>(supplier, accumulator, finisher, CH_ID);
    }
@ Deprecated public static < T , K , U , M extends Multimap < K , U > > Collector < T , ? , M > toMultimap ( Function < ? super T , ? extends K > keyMapper , Function < ? super T , ? extends U > valueMapper , Supplier < M > supplier ) { BiConsumer < M , T > accumulator = ( multimap , element ) -> multimap . put ( keyMapper . apply ( element ) , valueMapper . apply ( element ) ) ; BinaryOperator < M > finisher = ( m1 , m2 ) -> { m1 . putAll ( m2 ) ; return m1 ; } ; return new CollectorImpl <> ( supplier , accumulator , finisher , CH_ID ) ; }
use {@link com.google.common.collect.Multimaps#toMultimap(Function, Function, Supplier)} if using guava 21.0+
use {