### Question:
TopDownTreeBuilderImpl implements TopDownTreeRootBuilder.TopDownTreeBuilder<E, N> { @Override public <T extends Tree<E, N>> T build(Class<T> klass) throws OperationNotSupportedForType { final TreeConverter<E, N, T> converter = treeConverterProvider.get(klass); return converter.build(tree); } TopDownTreeBuilderImpl(TreeConverterProvider treeConverterProvider, E root); @Override T build(Class<T> klass); @Override T build(TypeKey<T> type); @Override TopDownTreeRootBuilder.TopDownTreeBuilderAppender<E> addChild(E e);  }### Answer:
@Test public void buildEmpty() { final TopDownTreeRootBuilderImpl<String, MutableSettableStructuredNode<String>> builder = new TopDownTreeRootBuilderImpl<>(TREE_CONVERTER_PROVIDER, EMPTY_TREE_CONSTRUCTOR_PROVIDER); final LinkedTree<String> tree = builder.build(LinkedTree.<String>typeKey()); assertNull(tree.getRoot()); assertTrue(tree.isEmpty()); }
@Test public void buildLeaf() { final TopDownTreeRootBuilderImpl<String, MutableSettableStructuredNode<String>> builder = new TopDownTreeRootBuilderImpl<>(TREE_CONVERTER_PROVIDER, EMPTY_TREE_CONSTRUCTOR_PROVIDER); final TopDownTreeRootBuilder.TopDownTreeBuilder<String, MutableSettableStructuredNode<String>> builder0 = builder.root("ROOT"); final LinkedTree<String> tree = builder0.build(LinkedTree.<String>typeKey()); assertEquals("ROOT", tree.getRoot().getElement()); assertEquals(0, tree.getNumberOfChildren()); assertFalse(tree.isEmpty()); }