Skip to content

Instantly share code, notes, and snippets.

@motlin
Created May 15, 2018 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motlin/8bd56e3aea317d45a02b8c7457353201 to your computer and use it in GitHub Desktop.
Save motlin/8bd56e3aea317d45a02b8c7457353201 to your computer and use it in GitHub Desktop.
Map<Color, Long> map =
people.stream().collect(Collectors.groupingBy(
Person::getFavoriteColor,
Collectors.counting()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment