@Test public void toImmutableSet() throws Exception { assertEquals(ImmutableSet.of(), Stream.of().collect(MoreCollectors.toImmutableSet())); assertEquals(ImmutableSet.of(1, 2, 4, 3, -1), Stream.of(-1, 1, 2, 3, 4).collect(MoreCollectors.toImmutableSet())); }
public static <T> Collector<T, ?, ImmutableSet<T>> toImmutableSet() { return Collector.of(ImmutableSet::<T>builder, ImmutableSet.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableSet.Builder::build); }
MoreCollectors { public static <T> Collector<T, ?, ImmutableSet<T>> toImmutableSet() { return Collector.of(ImmutableSet::<T>builder, ImmutableSet.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableSet.Builder::build); } }
MoreCollectors { public static <T> Collector<T, ?, ImmutableSet<T>> toImmutableSet() { return Collector.of(ImmutableSet::<T>builder, ImmutableSet.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableSet.Builder::build); } private  MoreCollectors(); }
MoreCollectors { public static <T> Collector<T, ?, ImmutableSet<T>> toImmutableSet() { return Collector.of(ImmutableSet::<T>builder, ImmutableSet.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableSet.Builder::build); } private  MoreCollectors(); static Collector<T, ?, ImmutableList<T>> toImmutableList(); static Collector<T, ?, ImmutableSet<T>> toImmutableSet(); static Collector<T, ?, ImmutableMap<K, U>> toImmutableMap(//
      Function<? super T, ? extends K> keyMapper, //
      Function<? super T, ? extends U> valueMapper); }
MoreCollectors { public static <T> Collector<T, ?, ImmutableSet<T>> toImmutableSet() { return Collector.of(ImmutableSet::<T>builder, ImmutableSet.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableSet.Builder::build); } private  MoreCollectors(); static Collector<T, ?, ImmutableList<T>> toImmutableList(); static Collector<T, ?, ImmutableSet<T>> toImmutableSet(); static Collector<T, ?, ImmutableMap<K, U>> toImmutableMap(//
      Function<? super T, ? extends K> keyMapper, //
      Function<? super T, ? extends U> valueMapper);  }