@Override
    public <S, C extends Config<S>> C applyConfig(S subject, Class<C> configClass, JsonNode json) {
        checkPermission(CONFIG_WRITE);
        checkNotNull(subject, NULL_SUBJECT_MSG);
        checkNotNull(configClass, NULL_CCLASS_MSG);
        checkNotNull(json, NULL_JSON_MSG);
        return store.applyConfig(subject, configClass, json);
    }
@Test
    public void testApplyConfig() {

        assertThat(configService.getSubjectFactory(String.class), nullValue());
        assertThat(configService.getSubjectFactory("key"), nullValue());

        registry.registerConfigFactory(config1Factory);
        registry.registerConfigFactory(config2Factory);
        configService.applyConfig("configKey", BasicConfig1.class, new ObjectMapper().createObjectNode());

        Config newConfig = configService.getConfig("configKey", BasicConfig1.class);
        assertThat(newConfig, notNullValue());

        assertThat(configService.getSubjectFactory(String.class), notNullValue());
        assertThat(configService.getSubjectFactory("key1"), notNullValue());
    }