@Test public void testNestingInArray() { Map<String, Object> objA = new HashMap<>(); objA.put("name", "Hans"); Map<String, Object> objB = new HashMap<>(); objB.put("name", "Fritz"); Map<String, Object> result = MapListTreeFlattener.flatten(Arrays.asList(objA, objB)); assertThat(result).hasSize(2); assertThat(result).containsEntry("[0].name", "Hans"); assertThat(result).containsEntry("[1].name", "Fritz"); }
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);  }