@Test public void testToFirst() { Integer collect = Stream.of(1, 2, 3).collect(CollectorsEx.toFirst()); assertEquals(1, collect.intValue()); }
public static <T> Collector<T, Ref<T>, T> toFirst() { return Collector.of( Ref::new, (a, v) -> { if (a.value == null) a.value = v; }, (a1, a2) -> a1, a -> a.value); }
CollectorsEx { public static <T> Collector<T, Ref<T>, T> toFirst() { return Collector.of( Ref::new, (a, v) -> { if (a.value == null) a.value = v; }, (a1, a2) -> a1, a -> a.value); } }
CollectorsEx { public static <T> Collector<T, Ref<T>, T> toFirst() { return Collector.of( Ref::new, (a, v) -> { if (a.value == null) a.value = v; }, (a1, a2) -> a1, a -> a.value); }  }
CollectorsEx { public static <T> Collector<T, Ref<T>, T> toFirst() { return Collector.of( Ref::new, (a, v) -> { if (a.value == null) a.value = v; }, (a1, a2) -> a1, a -> a.value); }  @SuppressWarnings("unchecked") static Collector<T, Void, Void> toVoid(); static Collector<T, Ref<T>, T> toFirst(); static Collector<T, Ref<T>, T> toLast(); static Collector<T, RefBoolean, Boolean> toAll(Predicate<? super T> predicate); static Collector<Boolean, RefBoolean, Boolean> toAll(); static Collector<T, RefBoolean, Boolean> toAny(Predicate<T> predicate); static Collector<Boolean, RefBoolean, Boolean> toAny(); static Collector<T, RefBoolean, Boolean> toNone(Predicate<T> predicate); static Collector<Boolean, RefBoolean, Boolean> toNone(); static BinaryOperator<T> throwingMerger(); static Collector<Entry<K, V>, ?, Map<K, V>> toMap(); static Collector<T, ?, Map<K, Set<V>>> toMultimap(Function<? super T, ? extends K> keyMapper,
			Function<? super T, ? extends V> valueMapper); }
CollectorsEx { public static <T> Collector<T, Ref<T>, T> toFirst() { return Collector.of( Ref::new, (a, v) -> { if (a.value == null) a.value = v; }, (a1, a2) -> a1, a -> a.value); }  @SuppressWarnings("unchecked") static Collector<T, Void, Void> toVoid(); static Collector<T, Ref<T>, T> toFirst(); static Collector<T, Ref<T>, T> toLast(); static Collector<T, RefBoolean, Boolean> toAll(Predicate<? super T> predicate); static Collector<Boolean, RefBoolean, Boolean> toAll(); static Collector<T, RefBoolean, Boolean> toAny(Predicate<T> predicate); static Collector<Boolean, RefBoolean, Boolean> toAny(); static Collector<T, RefBoolean, Boolean> toNone(Predicate<T> predicate); static Collector<Boolean, RefBoolean, Boolean> toNone(); static BinaryOperator<T> throwingMerger(); static Collector<Entry<K, V>, ?, Map<K, V>> toMap(); static Collector<T, ?, Map<K, Set<V>>> toMultimap(Function<? super T, ? extends K> keyMapper,
			Function<? super T, ? extends V> valueMapper); static final Collector<Object, Void, Void> TO_VOID; }