public static <T>T checkNotNull(T reference,@Nullable Object errorMessage){
  if (reference == null) {
    throw new NullPointerException(String.valueOf(errorMessage));
  }
  return reference;
}

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