public static void checkNotEmpty(CharSequence str,String message){
  if (str == null || str.length() == 0) {
    throw new IllegalArgumentException(message);
  }
}

public static void checkNotEmpty ( CharSequence str , String message ) { if ( str == null || str . length ( ) == 0 ) { throw new IllegalArgumentException ( message ) ; } }
throws an exception with a message , when charsequence is null
