code: @Override
    public void ensureValid(String setting, Object value) {
      if (null == value || !(value instanceof Integer)) {
        throw new ConfigException(setting, "Must be an integer.");
      }
      final Integer port = (Integer) value;
  
      if (!(port >= this.start && port <= this.end)) {
        throw new ConfigException(
            setting,
            String.format("(%s) must be between %s and %s.", port, this.start, this.end)
        );
      }
    }
docs: Method is used to validate that the supplied port is within the valid range.
  
  @param setting name of the setting being tested.
  @param value   value being tested.