Returns the maximum element using the given comparator, or null if the stream is empty.
the comparator.
the maximum element or null.