public static void checkNotNullOrEmpty(String string,String message){
  if (string == null || string.isEmpty()) {
    throw new IllegalArgumentException(message);
  }
}

public static void checkNotNullOrEmpty ( String string , String message ) { if ( string == null || string . isEmpty ( ) ) { throw new IllegalArgumentException ( message ) ; } }
validation method , which checks if a string is null or empty
