List of usage examples for java.util.stream LongStream collect
<R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R, R> combiner);
From source file:Main.java
public static void main(String[] args) { LongStream b = LongStream.of(1L, 2L, 3L, 4L); List<Long> v = b.collect(ArrayList::new, ArrayList::add, ArrayList::addAll); System.out.println(v);/*from w ww . jav a 2 s. c o m*/ }