I have noted that many Java 8 methods in Oracle JDK use Objects.requireNonNull(), which internally throws NullPointerException if the given object
Objects.requireNonNull()
NullPointerException
The basic usage is checking and throwing NullPointerException immediately.
One better alternative (shortcut) to cater to the same requirement is @NonNull annotation by lombok.