fix compare to

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