static void throwIfArgumentToLong(String tag,String arg,int limit){
  if (arg != null && arg.length() > limit) {
    throw new IllegalArgumentException(String.format("Argument %s too long. %d characters is the maximum.",tag,limit));
  }
}

static void throwIfArgumentToLong ( String tag , String arg , int limit ) { if ( arg != null && arg . length ( ) > limit ) { throw new IllegalArgumentException ( String . format ( "Argument %s too long. %d characters is the maximum." , tag , limit ) ) ; } }
throw an exception with explicit message .
