class CentralizedManagement {
    // Merge map config with values generated by ConfigInjection.class and return map
    public static void mergeMap(boolean decrypt, Map<String, Object> config) {
        merge(decrypt, config);
    }
    // Merge map config with values generated by ConfigInjection.class and return mapping object
    public static Object mergeObject(boolean decrypt, Object config, Class clazz) {
        merge(decrypt, config);
        return convertMapToObj((Map<String, Object>) config, clazz);
    }
    // Search the config map recursively, expand List and Map level by level util no further expand
    private static void merge(boolean decrypt, Object m1) {
        if (m1 instanceof Map) {
            Iterator<Object> fieldNames = ((Map<Object, Object>) m1).keySet().iterator();
            String fieldName = null;
            Map<String, Object> mapWithInjectedKey = new HashMap<>();
            while (fieldNames.hasNext()) {
                fieldName = String.valueOf(fieldNames.next());
                Object field1 = ((Map<String, Object>) m1).get(fieldName);
                if (field1 != null) {
                    if (field1 instanceof Map || field1 instanceof List) {
                        merge(decrypt, field1);
                    // Overwrite previous value when the field1 can not be expanded further
                    } else if (field1 instanceof String) {
                        // Retrieve values from ConfigInjection.class
                        Object injectValue = ConfigInjection.getInjectValue((String) field1, decrypt);
                        ((Map<String, Object>) m1).put(fieldName, injectValue);
                    }
                }
                // post order, in case the key of configuration can also be injected.
                Object injectedFieldName = ConfigInjection.getInjectValue(fieldName, decrypt);
                // only inject when key has been changed
                if (!fieldName.equals(injectedFieldName)) {
                    validateInjectedFieldName(fieldName, injectedFieldName);
                    // the map is unmodifiable during iterator, so put in another map and put it back after iteration.
                    mapWithInjectedKey.put((String)ConfigInjection.getInjectValue(fieldName, decrypt), field1);
                    fieldNames.remove();
                }
            }
            // put back those updated keys
            ((Map<String, Object>) m1).putAll(mapWithInjectedKey);
        } else if (m1 instanceof List) {
            for (int i = 0; i < ((List<Object>) m1).size(); i++) {
                Object field1 = ((List<Object>) m1).get(i);
                if (field1 instanceof Map || field1 instanceof List) {
                    merge(decrypt, field1);
                // Overwrite previous value when the field1 can not be expanded further
                } else if (field1 instanceof String) {
                    // Retrieve values from ConfigInjection.class
                    Object injectValue = ConfigInjection.getInjectValue((String) field1, decrypt);
                    ((List<Object>) m1).set(i, injectValue);
                }
            }
        }
    }

    private static void validateInjectedFieldName(String fieldName, Object injectedFieldName) {<FILL_FUNCTION_BODY>}

    // Method used to convert map to object based on the reference class provided
    private static Object convertMapToObj(Map<String, Object> map, Class clazz) {
        ObjectMapper mapper = new ObjectMapper();
        Object obj = mapper.convertValue(map, clazz);
        return obj;
    }
}

        if (injectedFieldName == null) {
            throw new RuntimeException("the overwritten value cannot be null for key:" + fieldName);
        }
        if (!(injectedFieldName instanceof String)) {
            throw new RuntimeException("the overwritten value for key has to be a String" + fieldName);
        }
        if(((String) injectedFieldName).isBlank()) {
            throw new RuntimeException("the overwritten value cannot be empty for key:" + fieldName);
        }
    
<no_super_class>