Skip to content

Instantly share code, notes, and snippets.

@mcupak
Created November 10, 2017 01:38
Show Gist options
  • Select an option

  • Save mcupak/3a7f86a07b805b822216c76f0dacbb34 to your computer and use it in GitHub Desktop.

Select an option

Save mcupak/3a7f86a07b805b822216c76f0dacbb34 to your computer and use it in GitHub Desktop.
jshell> entries.collect(Collectors.groupingBy(e -> e.getKey(), Collectors.mapping(e -> e.getValue(), Collectors.toSet())))
$1 ==> {1=[[b, a], [c, a]], 2=[[d]]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment