@Test public void toImmutableList() throws Exception { assertEquals(ImmutableList.of(), Stream.of().collect(MoreCollectors.toImmutableList())); assertEquals(ImmutableList.of(1, 2, 3, 4), Stream.of(1, 2, 3, 4).collect(MoreCollectors.toImmutableList())); }
public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList() { return Collector.of(ImmutableList::<T>builder, ImmutableList.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableList.Builder::build); }
MoreCollectors { public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList() { return Collector.of(ImmutableList::<T>builder, ImmutableList.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableList.Builder::build); } }
MoreCollectors { public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList() { return Collector.of(ImmutableList::<T>builder, ImmutableList.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableList.Builder::build); } private  MoreCollectors(); }
MoreCollectors { public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList() { return Collector.of(ImmutableList::<T>builder, ImmutableList.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableList.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, ?, ImmutableList<T>> toImmutableList() { return Collector.of(ImmutableList::<T>builder, ImmutableList.Builder<T>::add, (left, right) -> left.addAll(right.build()), ImmutableList.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);  }