public static void inRange(final long value,final String name,final long minInclusive,final long maxInclusive){
  if (value < minInclusive || value > maxInclusive) {
    final String message=String.format("%s must be between %d and %d inclusive",name,minInclusive,maxInclusive);
    throw new IllegalArgumentException(message);
  }
}

public static void inRange ( final long value , final String name , final long minInclusive , final long maxInclusive ) { if ( value < minInclusive || value > maxInclusive ) { final String message = String . format ( "%s must be between %d and %d inclusive" , name , minInclusive , maxInclusive ) ; throw new IllegalArgumentException ( message ) ; } }
throws an exception if the specified long value is not in the specified inclusive range .
