MCPcopy Create free account
hub / github.com/Card-Forge/forge / groupSumBy

Method groupSumBy

forge-core/src/main/java/forge/util/Aggregates.java:237–239  ·  view source on GitHub ↗
(Iterable<Entry<T, Integer>> source, Function<T, U> fnGetField)

Source from the content-addressed store, hash-verified

235 }
236
237 public static <T, U> Iterable<Entry<U, Integer>> groupSumBy(Iterable<Entry<T, Integer>> source, Function<T, U> fnGetField) {
238 return StreamUtil.stream(source).collect(Collectors.groupingBy(kv -> fnGetField.apply(kv.getKey()), Collectors.summingInt(e -> e.getValue()))).entrySet();
239 }
240}

Callers 2

getAllowedAdditionsMethod · 0.95

Calls 4

streamMethod · 0.95
applyMethod · 0.65
getKeyMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected