@Override
        public void ensureValid(String name, Object o) {
            String s = (String) o;
            if (!validStrings.contains(s)) {
                throw new ConfigException(name, o, "String must be one of: " + String.join(", ", validStrings));
            }

        }
A numeric range that checks both the upper (inclusive) and lower bound
clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java