@Test public void testCollectToBiMap() { BiMap<String, Integer> bimap = Stream.of(1, 2).collect( GuavaCollectors.toBiMap(Object::toString, Function.identity())); Truth.assertThat(bimap).hasSize(2); Truth.assertThat(bimap).containsEntry("1", 1); Truth.assertThat(bimap.inverse()).containsEntry(2, "2"); }
public static <T, K, U> Collector<T, ?, BiMap<K, U>> toBiMap( Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) { return toBiMap(keyMapper, valueMapper, throwingMerger()); }
GuavaCollectors { public static <T, K, U> Collector<T, ?, BiMap<K, U>> toBiMap( Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) { return toBiMap(keyMapper, valueMapper, throwingMerger()); } }
GuavaCollectors { public static <T, K, U> Collector<T, ?, BiMap<K, U>> toBiMap( Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) { return toBiMap(keyMapper, valueMapper, throwingMerger()); } private  GuavaCollectors(); }
GuavaCollectors { public static <T, K, U> Collector<T, ?, BiMap<K, U>> toBiMap( Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) { return toBiMap(keyMapper, valueMapper, throwingMerger()); } private  GuavaCollectors(); static Collector<T, ?, Table<R, C, V>> toTable(
            Function<? super T, ? extends R> rowMapper,
            Function<? super T, ? extends C> columnMapper,
            Function<? super T, ? extends V> valueMapper); static Collector<T, ?, Table<R, C, V>> toTable(
            Function<? super T, ? extends R> rowMapper,
            Function<? super T, ? extends C> columnMapper,
            Function<? super T, ? extends V> valueMapper,
            BinaryOperator<V> mergeFunction); static Collector<T, ?, BiMap<K, U>> toBiMap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper); static Collector<T, ?, BiMap<K, U>> toBiMap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper,
            BinaryOperator<U> mergeFunction); static Collector<T, ?, ImmutableBiMap<K, U>> toImmutableBiMap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper,
            BinaryOperator<U> mergeFunction); static Collector<T, ?, Multimap<K, U>> toMultimap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper); static Collector<T, ?, ImmutableMultimap<K, U>> toImmutableMultimap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper); static Collector<T, ?, Multiset<T>> toMultiset(); }
GuavaCollectors { public static <T, K, U> Collector<T, ?, BiMap<K, U>> toBiMap( Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) { return toBiMap(keyMapper, valueMapper, throwingMerger()); } private  GuavaCollectors(); static Collector<T, ?, Table<R, C, V>> toTable(
            Function<? super T, ? extends R> rowMapper,
            Function<? super T, ? extends C> columnMapper,
            Function<? super T, ? extends V> valueMapper); static Collector<T, ?, Table<R, C, V>> toTable(
            Function<? super T, ? extends R> rowMapper,
            Function<? super T, ? extends C> columnMapper,
            Function<? super T, ? extends V> valueMapper,
            BinaryOperator<V> mergeFunction); static Collector<T, ?, BiMap<K, U>> toBiMap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper); static Collector<T, ?, BiMap<K, U>> toBiMap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper,
            BinaryOperator<U> mergeFunction); static Collector<T, ?, ImmutableBiMap<K, U>> toImmutableBiMap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper,
            BinaryOperator<U> mergeFunction); static Collector<T, ?, Multimap<K, U>> toMultimap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper); static Collector<T, ?, ImmutableMultimap<K, U>> toImmutableMultimap(
            Function<? super T, ? extends K> keyMapper,
            Function<? super T, ? extends U> valueMapper); static Collector<T, ?, Multiset<T>> toMultiset();  }