public static void notNull(final Object obj,final String name){
  if (null == obj) {
    final String message=String.format("%s cannot be null",name);
    throw new IllegalArgumentException(message);
  }
}

public static void notNull ( final Object obj , final String name ) { if ( null == obj ) { final String message = String . format ( "%s cannot be null" , name ) ; throw new IllegalArgumentException ( message ) ; } }
throws an exception if the specified object is null .
