Stream examples Part 3 - Conclusion
I would like to wrap up with some snippets I use a lot! Collect to a map When you want to collect to a Map, you need a function for the key and a function for the value. Suppose you have a list of Person objects with a firstname and last name. If you want to map the firstname to the lastname, you would write something like this: Map<String, String> firstToLastMap = persons....