class FlatMapUtils {

    public static Map<String, Object> flatten(Map<String, Object> map) {
        return map.entrySet()
                   .stream()
                   .flatMap(FlatMapUtils::flatten)
                   .collect(LinkedHashMap::new, (m, e) -> m.put("/" + e.getKey(), e.getValue()), LinkedHashMap::putAll);
    }

    private  FlatMapUtils();

}