Did you know that you can navigate the posts by swiping left and right?
Java 8 can group elements in a stream based on a provided lambda using a collector.
This is easy by using Collectors.groupBy
Stream.of(...).collect(Collectors.groupBy(...))
The example below does the following:
You can also check this more complete example with variations on how to call Collectors.groupBy, or find all my java 8 excercises in this repo: java8-examples