@Test
    public void shouldMergeTreesCorrectly() {
        Tree<String> tree1 = new Tree<>();
        tree1.put("1", new Tree<String>(TreeTest.createTree("1_1", new Tree<String>("1_1_1")), TreeTest.createTree("1_2", new Tree<String>("1_2_1"))));
        Tree<String> tree2 = new Tree<>();
        tree2.put("1", new Tree<String>(TreeTest.createTree("1_1", new Tree<String>("1_1_1")), TreeTest.createTree("1_2", new Tree<String>("1_2_2"))));

        Tree<String> mergeTree = new Tree<>();
        mergeTree.addTree(tree1);
        mergeTree.addTree(tree2);

        assertEquals(1, mergeTree.size());
        assertEquals(0, mergeTree.getObjectsAtDepth(0).size());
        assertEquals(1, mergeTree.getObjectsAtDepth(1).size());
        assertEquals(2, mergeTree.getObjectsAtDepth(2).size());
        assertEquals(3, mergeTree.getObjectsAtDepth(3).size());
        assertTrue(mergeTree.getObjectsAtDepth(3).contains("1_1_1"));
        assertTrue(mergeTree.getObjectsAtDepth(3).contains("1_2_1"));
        assertTrue(mergeTree.getObjectsAtDepth(3).contains("1_2_2"));
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
@author Daniel Kuppitz (http://gremlin.guru)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TreeTest.java