public static <T> Collector<T, ?, Quantile> toMedian(
		final ToDoubleFunction<? super T> mapper
	) {
		requireNonNull(mapper);

		return Collector.of(
			Quantile::median,
			(r, t) -> r.accept(mapper.applyAsDouble(t)),
			Quantile::combine
		);
	}
Return a {@code Collector} which applies a double-producing mapping
function to each input element, and returns the median for the resulting
values.
{@snippet lang="java":
final Stream<SomeObject> stream = null; // @replace substring='null' replacement="..."
final Quantile median = stream.collect(toMedian(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 quantile reduction
@throws java.lang.NullPointerException if the given {@code mapper} is
        {@code null}
jenetics/src/main/java/io/jenetics/stat/Quantile.java