class MapUtils {

    public static Map<String, String> flattenMap(String rootKey, Map<String, Object> collection) {
        if (collection == null || collection.isEmpty()) {
            return Collections.emptyMap();
        }

        Map<String, String> result = new HashMap<>();

        for (Map.Entry<String, Object> entry : collection.entrySet()) {
            if (entry.getValue() == null) {
                result.put( mergeKey(rootKey, entry.getKey()), "");
                continue;
            }
            executeAction(new Argument(entry, result, rootKey));
        }
        return result;
    }

}