Skip to content

Instantly share code, notes, and snippets.

@r-winkler
Created August 10, 2016 17:29
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 r-winkler/376a0e3e00d4f37b2afbaf151ac9bc1a to your computer and use it in GitHub Desktop.
Save r-winkler/376a0e3e00d4f37b2afbaf151ac9bc1a to your computer and use it in GitHub Desktop.
Map<String, Integer> accumulator = items.stream().collect(Collectors.groupingBy(Item::getName, Collectors.summingInt(Item::getValue)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment