static Map<String, Object> javaSerializationFilterGenerator(JavaSerializationFilterConfig jsfConfig) {
        Map<String, Object> javaSerializationFilterCfg = new LinkedHashMap<>();
        addNonNullToMap(javaSerializationFilterCfg, "defaults-disabled", jsfConfig.isDefaultsDisabled());
        Map<String, Object> whiteListAsMap = classFilterGenerator(jsfConfig.getWhitelist());
        Map<String, Object> blackListAsMap = classFilterGenerator(jsfConfig.getBlacklist());
        javaSerializationFilterCfg.put("blacklist", blackListAsMap);
        javaSerializationFilterCfg.put("whitelist", whiteListAsMap);
        return javaSerializationFilterCfg;
    }
@Test
    public void testJavaSerializationConfig() {
        JavaSerializationFilterConfig jsfConfig = new JavaSerializationFilterConfig();
        jsfConfig.setDefaultsDisabled(true);
        jsfConfig.setBlacklist(createClassFilter());

        Map<String, Object> jsfAsMap = DynamicConfigYamlGenerator.javaSerializationFilterGenerator(jsfConfig);
        assertTrue((boolean) jsfAsMap.get("defaults-disabled"));
        assertClassFilterAsMap((Map<String, Object>) jsfAsMap.get("blacklist"));
    }