public static < T > T checkNotNull ( T reference , @ Nullable String errorMessageTemplate , @ Nullable Object ... errorMessageArgs ) { if ( reference == null ) { throw new NullPointerException ( format ( errorMessageTemplate , errorMessageArgs ) ) ; } return reference ; }
Ensures that an object reference passed as a parameter to the calling method is not null .