public static List<UnifiedPathPrefixAuth> populatePathPrefixAuths(List<Map<String, Object>> values) {
        List<UnifiedPathPrefixAuth> pathPrefixAuths = new ArrayList<>();
        for(Map<String, Object> value: values) {
            UnifiedPathPrefixAuth unifiedPathPrefixAuth = new UnifiedPathPrefixAuth();
            unifiedPathPrefixAuth.setPrefix((String)value.get(PREFIX));
            unifiedPathPrefixAuth.setBasic(value.get(BASIC) == null ? false : (Boolean)value.get(BASIC));
            unifiedPathPrefixAuth.setJwt(value.get(JWT) == null ? false : (Boolean)value.get(JWT));
            unifiedPathPrefixAuth.setSjwt(value.get(SJWT) == null ? false : (Boolean)value.get(SJWT));
            unifiedPathPrefixAuth.setSwt(value.get(SWT) == null ? false : (Boolean)value.get(SWT));
            unifiedPathPrefixAuth.setApikey(value.get(APIKEY) == null ? false : (Boolean)value.get(APIKEY));
            Object jwkIds = value.get(JWK_SERVICE_IDS);
            if(jwkIds instanceof String) {
                String s = (String)value.get(JWK_SERVICE_IDS);
                if(s.startsWith("[")) {
                    // json format
                    try {
                        unifiedPathPrefixAuth.setJwkServiceIds(Config.getInstance().getMapper().readValue(s, new TypeReference<List<String>>() {}));
                    } catch (Exception e) {
                        logger.error("could not parse the jwkServiceIds json with a list of strings.", e);
                        throw new ConfigException("could not parse the jwkServiceIds json with a list of strings.");
                    }
                } else {
                    // comma separated
                    unifiedPathPrefixAuth.setJwkServiceIds(Arrays.asList(s.split("\\s*,\\s*")));
                }
            } else if(jwkIds instanceof List ) {
                // it must be a json array.
                unifiedPathPrefixAuth.setJwkServiceIds((List)jwkIds);
            }
            Object sjwkIds = value.get(SJWK_SERVICE_IDS);
            if(sjwkIds instanceof String) {
                String s = (String)value.get(SJWK_SERVICE_IDS);
                if(s.startsWith("[")) {
                    // json format
                    try {
                        unifiedPathPrefixAuth.setSjwkServiceIds(Config.getInstance().getMapper().readValue(s, new TypeReference<List<String>>() {}));
                    } catch (Exception e) {
                        logger.error("could not parse the sjwkServiceIds json with a list of strings.", e);
                        throw new ConfigException("could not parse the sjwkServiceIds json with a list of strings.");
                    }
                } else {
                    // comma separated
                    unifiedPathPrefixAuth.setSjwkServiceIds(Arrays.asList(s.split("\\s*,\\s*")));
                }
            } else if(jwkIds instanceof List ) {
                // it must be a json array.
                unifiedPathPrefixAuth.setSjwkServiceIds((List)sjwkIds);
            }
            Object swtIds = value.get(SWT_SERVICE_IDS);
            if(swtIds instanceof String) {
                String s = (String)value.get(SWT_SERVICE_IDS);
                if(s.startsWith("[")) {
                    // json format
                    try {
                        unifiedPathPrefixAuth.setSwtServiceIds(Config.getInstance().getMapper().readValue(s, new TypeReference<List<String>>() {}));
                    } catch (Exception e) {
                        logger.error("could not parse the swtServiceIds json with a list of strings.", e);
                        throw new ConfigException("could not parse the swtServiceIds json with a list of strings.");
                    }
                } else {
                    // comma separated
                    unifiedPathPrefixAuth.setSwtServiceIds(Arrays.asList(s.split("\\s*,\\s*")));
                }
            } else if(swtIds instanceof List ) {
                // it must be a json array.
                unifiedPathPrefixAuth.setSwtServiceIds((List)swtIds);
            }
            pathPrefixAuths.add(unifiedPathPrefixAuth);
        }
        return pathPrefixAuths;
    }
@Test
    public void testPathPrefixAuth() {
        String s = "[{\"prefix\":\"/adm/modules\",\"basic\":true},{\"prefix\":\"/adm/server\",\"basic\":true},{\"prefix\":\"/adm/logger\",\"basic\":true},{\"prefix\":\"/adm/health\",\"basic\":true},{\"prefix\":\"/gateway/NavigationTP\",\"jwt\":true,\"jwkServiceIds\":\"Navigation, NavigationJWT\"}]";
        if(s.startsWith("[")) {
            // json format
            try {
                List<Map<String, Object>> values = Config.getInstance().getMapper().readValue(s, new TypeReference<>() {});
                Assert.assertEquals(5, values.size());
                List<UnifiedPathPrefixAuth> pathPrefixAuths = UnifiedSecurityConfig.populatePathPrefixAuths(values);
                Assert.assertEquals(5, pathPrefixAuths.size());
            } catch (Exception e) {
                e.printStackTrace();
                throw new ConfigException("could not parse the pathPrefixAuths json with a list of string and object.");
            }
        } else {
            throw new ConfigException("pathPrefixAuths must be a list of string object map.");
        }
    }