public static <T> Collector<T, ?, DoubleSummary>
	toDoubleSummary(final ToDoubleFunction<? super T> mapper) {
		requireNonNull(mapper);
		return Collector.of(
			DoubleSummaryStatistics::new,
			(a, b) -> a.accept(mapper.applyAsDouble(b)),
			(a, b) -> {a.combine(b); return a;},
			DoubleSummary::of
		);
	}
Return a {@code Collector} which applies a double-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 DoubleSummary summary = stream
    .collect(toDoubleSummary(v -> v.doubleValue()));
}

@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/DoubleSummary.java