public static <T> Collector<T, ?, LongMomentStatistics>
	toLongMomentStatistics(final ToLongFunction<? super T> mapper) {
		requireNonNull(mapper);
		return Collector.of(
			LongMomentStatistics::new,
			(r, t) -> r.accept(mapper.applyAsLong(t)),
			LongMomentStatistics::combine
		);
	}
Return a {@code Collector} which applies a long-producing mapping
function to each input element, and returns moments-statistics for the
resulting values.
{@snippet lang="java":
final Stream<SomeObject> stream = null; // @replace substring='null' replacement="..."
final LongMomentStatistics statistics = stream
    .collect(toLongMomentStatistics(v -> v.longValue()));
}

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