public static <T> Collector<T, ?, MinMax<T>>
	toMinMax(final Comparator<? super T> comparator) {
		requireNonNull(comparator);
		return Collector.of(
			() -> MinMax.of(comparator),
			MinMax::accept,
			MinMax::combine
		);
	}
Return a {@code Collector} which calculates the minimum and maximum value.
The given {@code comparator} is used for comparing two objects.
{@snippet lang="java":
final Comparator<SomeObject> comparator = null; // @replace substring='null' replacement="..."
final Stream<SomeObject> stream = null; // @replace substring='null' replacement="..."
final MinMax<SomeObject> moments = stream
    .collect(doubleMoments.toMinMax(comparator));
}

@param comparator the {@code Comparator} to use
@param <T> the type of the input elements
@return a {@code Collector} implementing the min-max reduction
@throws java.lang.NullPointerException if the given {@code mapper} is
        {@code null}
jenetics/src/main/java/io/jenetics/stat/MinMax.java