public static <T> Collector<T, ?, IntSummary>
	toIntSummary(final ToIntFunction<? super T> mapper) {
		requireNonNull(mapper);
		return Collector.of(
			IntSummaryStatistics::new,
			(a, b) -> a.accept(mapper.applyAsInt(b)),
			(a, b) -> {a.combine(b); return a;},
			IntSummary::of
		);
	}
Return a {@code Collector} which applies an int-producing mapping
function to each input element, and return summary-statistics for the
resulting values.
{@snippet lang="java":
final Stream<SomeObject> stream = null; // @replace substring='null' replacement="..."
final IntSummary summary = stream
    .collect(toIntSummary(v -> v.intValue()));
}

@param mapper a mapping function to apply to each element
@param <T> the type of the input elements
@return a {@code Collector} implementing the summary-statistics reduction
@throws java.lang.NullPointerException if the given {@code mapper} is
        {@code null}
jenetics/src/main/java/io/jenetics/stat/IntSummary.java