Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mcupak/b35a060a0c09175ed95d81245ea6dbeb to your computer and use it in GitHub Desktop.
Save mcupak/b35a060a0c09175ed95d81245ea6dbeb to your computer and use it in GitHub Desktop.
jshell> numbers.stream().collect(Collectors.groupingBy(i -> i % 2, Collectors.filtering(j -> j > 5, Collectors.counting())))
$3 ==> {0=0, 1=3}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment