This tutorial outlines the API collector Collectors.groupingBy() which is used in the terminal operation collect(). Code examples detail obtaining a List versus Set view of the values in your Map. In addition, how to guarantee a TreeMap implementation is demonstrated.
The full Streams playlist is here: • Playlist
0:00 Introduction
0:32 List view of the values
1:19 Set view of the values
2:13 TreeMap implementation