public static <E extends Comparable<? super E>> Stream<E> filteringAllMax(Stream<E> stream) {

        Objects.requireNonNull(stream);

        return filteringAllMax(stream, Comparator.naturalOrder());
    }
public static < E extends Comparable < ? super E > > Stream < E > filteringAllMax ( Stream < E > stream ) { Objects . requireNonNull ( stream ) ; return filteringAllMax ( stream , Comparator . naturalOrder ( ) ) ; }
<p>Generates a stream only composed of the greatest elements of the provided stream, compared using their
natural order. </p>
<p>A <code>NullPointerException</code> will be thrown if the provided stream is null. </p>

@param stream the processed stream
@param <E>    the type of the provided stream
@return a filtered stream