code: public static void isBetween(Integer value, int min, int max, String name) {
      notNull(value, name);
  
      if (value < min || value > max) {
        throw new IllegalArgumentException(name + "(" + value + ") out of range: " + min + " <= " + name + " <= " + max);
      }
    }
docs: Checks that i is not null and is in the range min &lt;= i &lt;= max.
  
  @param value    The integer value to check.
  @param min  The minimum bound, inclusive.
  @param max  The maximum bound, inclusive.
  @param name The name of the variable being checked, included when an error is raised.
  @throws IllegalArgumentException If i is null or outside the range.