public ConfigDef define(ConfigKey key) {
        if (configKeys.containsKey(key.name)) {
            throw new ConfigException("Configuration " + key.name + " is defined twice.");
        }
        if (key.group != null && !groups.contains(key.group)) {
            groups.add(key.group);
        }
        configKeys.put(key.name, key);
        return this;
    }
@Test
    public void testNoExceptionIsThrownWhenListSizeIsBelowTheLimit() {
        assertDoesNotThrow(() -> new ConfigDef().define("lst",
                                                        Type.LIST,
                                                        asList("a", "b"),
                                                        ListSize.atMostOfSize(3),
                                                        Importance.HIGH,
                                                        "lst doc"));
    }