code: public static void lessThan(long value, long maxValue, String name) {
          if (value <= 0) {
              throw new IllegalArgumentException(name + " should be > 0, current value " + value);
          }
          if (value > maxValue) {
              throw new IllegalArgumentException(name + " should be <= " + maxValue + ", current value " + value);
          }
      }
docs: Checks that the given value is <= max value.
  @param value
  @param maxValue
  @param name