public static < E > E notNull ( E obj , String msg ) { if ( obj == null ) { throw ( msg == null ) ? new NullPointerException ( ) : new NullPointerException ( msg ) ; } return obj ; }
An assertion method that makes null validation more fluent