The static method, Collectors.summingInt() returns a Collector which uses a provided mapper function to convert each input element of type T to primitive int, and returns the sum of the resulting integer values.
<T> Collector<T,?,Integer> summingInt(ToIntFunction<? super T> mapper)