### Question:
PluginTree implements Iterable { public static PluginTree buildTree(Map<String, Plugin> pluginMap) { PluginTree mainRoot = new PluginTree(); final Map<String, List<Plugin>> consumers = findConsumers(pluginMap); buildLeaf(mainRoot, consumers, null); return mainRoot; } PluginTree();  PluginTree(Plugin plugin); Plugin getPlugin(); List<PluginTree> getChildren(); PluginTree getChild(String id); List<List<PluginTree>> getRoutes(); static PluginTree buildTree(Map<String, Plugin> pluginMap); @Override Iterator iterator();  }### Answer:
@Test public void testBuildTree() { assertEquals(tree.getChildren().size(), 2); assertEquals(tree.getChild("root1").getChildren().size(), 2); assertEquals(tree.getChild("root2").getChildren().size(), 2); assertEquals(tree.getChild("root1").getChild("root1.branch1").getChildren().size(), 2); assertEquals(tree.getChild("root1").getChild("root1.branch2").getChildren().size(), 1); assertEquals(tree.getChild("root2").getChild("root2.branch2").getChildren().size(), 3); assertEquals(tree.getChild("root2").getChild("root2.branch1").getChildren().size(), 1); }