If I have a List
, how can I turn that into a >
List
that contains all the objects in the same iteration order by using the features of Java 8?
Answer
You can use flatMap
to flatten the internal lists (after converting them to Streams) into a single Stream, and then collect the result into a list:
List> list = ...
List
No comments:
Post a Comment