Last updated 1 year ago
Stream Support Since Java 1.8
Use FlatMap to flatten the internal lists into a single Stream, and the collect the result into a list:
FlatMap
List<List<Object>> list = ..... List<Object> flat = list.stream() .flatMap(List::stream) .collect(Collectors.toList());