I want to collect a list result from a parallel stream into one list. Lets look at this code to explain my issue better. This is what I get:
List<Object> a = new ArrayList<>();
List<List<Object>> result a.parallelStream() // I get a List of List
.map(a -> { return new ArrayList(); })
.collect(Collectors.toList());
But what I really want to have is more like this:
List<Object> a = new ArrayList<>();
List<Object> result a.parallelStream() // I want to add all list elements into one List of objects
.map(a -> { return new ArrayList(); })
.collect(Collectors.???);