Created
July 24, 2019 23:44
-
-
Save beall49/aeb7d7fbb6707ead8a449c445d473d3a to your computer and use it in GitHub Desktop.
A list of items that gets a list into a single list :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Take a list of items, iterate, and get some list of items then flatten that list of items into a single list. | |
*/ | |
List<String> indexed = listOfStrings.stream() | |
.map(li -> li.getSomeListOfItems()) | |
.flatMap(List::stream) | |
.collect(toList()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment