public static void checkNotEmpty(String string){
  if (string.isEmpty()) {
    throw new NullPointerException();
  }
}

public static void checkNotEmpty ( String string ) { if ( string . isEmpty ( ) ) { throw new NullPointerException ( ) ; } }
ensures that an string reference passed as a parameter to the calling method is not empty .
