The following code snippets contains a method for finding min and max elements of a stream in accordance with a given comparator. The stream elements are of generic type T, and the given Comparator<? super T> order is used to find the minimum and maximum.
After you find the minimum and maximum elements, you should pass them to minMaxConsumer in the following way:
minMaxConsumer.accept(min, max);