### Question:
PluginTree implements Iterable { public Plugin getPlugin() { return plugin; } 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 testTreeRouteBuild() { PluginTreeRouteBuilder builder = new PluginTreeRouteBuilder(tree); List<List<PluginTree>> routes = builder.build(); final String[][] routesCheck = new String[][]{ {"root1", "root1.branch1", "root1.branch1.leaf1"}, {"root1", "root1.branch1", "root1.branch1.leaf2"}, {"root1", "root1.branch2", "root1.branch2.leaf1"}, {"root2", "root2.branch1", "root2.branch1.leaf1"}, {"root2", "root2.branch2", "root2.branch2.leaf1"}, {"root2", "root2.branch2", "root2.branch2.leaf2"}, {"root2", "root2.branch2", "root2.branch2.leaf3"}, }; int i = 0; for (List<PluginTree> route : routes) { int j = -1; for (PluginTree node : route) { if (node.getPlugin() != null) { assertEquals(routesCheck[i][j], node.getPlugin().getId()); } j++; } i++; } }