code: public static void assertParameterWithinBounds(String name, long lower, long upper, long parameter) {
          if (parameter < lower || parameter > upper) {
              throw new IllegalArgumentException(String.format("Invalid %s: %d (expected: %d <= n < %d)",
                      name, parameter, lower, upper + 1));
          }
      }
docs: Throw an {@link IllegalArgumentException} when a number is not within the supplied range.
  
  @param name      Name of the parameter to use in the Exception message.
  @param lower     Lower bound (inclusive).
  @param upper     Upper bound (inclusive).
  @param parameter The parameter to test.
  @throws IllegalArgumentException Thrown when the parameter is out of bounds.