@Test public void testListFlattening() { Map<String, Object> root = new HashMap<>(); root.put("l1", Arrays.asList("A", "B", "C")); root.put("l2", Arrays.asList(42)); Map<String, Object> result = MapListTreeFlattener.flatten(root); assertThat(result).hasSize(4); assertThat(result).containsEntry("l1[0]", "A"); assertThat(result).containsEntry("l1[1]", "B"); assertThat(result).containsEntry("l1[2]", "C"); assertThat(result).containsEntry("l2[0]", 42); }
public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; }
MapListTreeFlattener { public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; } }
MapListTreeFlattener { public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; }  }
MapListTreeFlattener { public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; }  static Map<String, Object> flatten(Object root); }
MapListTreeFlattener { public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; }  static Map<String, Object> flatten(Object root);  }