public void flattenTree() throws IOException {
Tree<String> tree = new Tree<String>("root");
Node<String> child1 = tree.addChild("child1");
child1.addChild("grandchild");
Node child2 = tree.addChild("child2");
child2.addChild("grandchild");
Set<String> elements = tree.flatten();
assertNotNull(elements);
assertEquals(4, elements.size());
assertTrue(elements.contains("root"));