fix compare to problem

By documentations compareTo should returns NPE when the object is null.
Using Objects.requireNonNull it avoid the JIT blind the class and then make it slower.
https://bugs.openjdk.java.net/browse/JDK-8042127