/** * Returns a {@code DoubleCollector} that produces the maximal element, * described as an {@link OptionalDouble}. If no elements are present, the * result is an empty {@code OptionalDouble}. * * @return a {@code DoubleCollector} that produces the maximal element. */ static DoubleCollector<?, OptionalDouble> max() { return reducing(Double::max); }
/** * Returns a {@code DoubleCollector} that produces the minimal element, * described as an {@link OptionalDouble}. If no elements are present, the * result is an empty {@code OptionalDouble}. * * @return a {@code DoubleCollector} that produces the minimal element. */ static DoubleCollector<?, OptionalDouble> min() { return reducing(Double::min); }