@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");
}