List of usage examples for java.util.stream IntStream collect
<R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R, R> combiner);
From source file:Main.java
public static void main(String[] args) { IntStream i = IntStream.of(6, 5, 7, 1, 2, 3, 3); List<Integer> v = i.collect(ArrayList::new, ArrayList::add, ArrayList::addAll); System.out.println(v);/* w ww .j a v a 2 s. com*/ }