public static < T > T checkNotNull ( T obj , String name ) { if ( obj == null ) { String msg = String . format ( "parameter '%s' cannot be null" , name ) ; throw new NullPointerException ( msg ) ; } return obj ; }
Ensures the object reference is not null .