Tree extends Node { public void buildFromList(Iterable<?> segments) { build(this, segments, 1); } Tree(); int getMaxDepth(); void buildFromPath(String path); void buildFromArray(String[] segments); void buildFromList(Iterable<?> segments); List<Node> getLeafNodes(); List<Node> getLeafNodes(Node startNode, List<Node> collectNodes); List<String> getLeafFacets(); List<String> getLeafFacets(String separator, boolean includeLevel); List<String> getLeafPaths(String separator);  }
@Test public void buildFromList() { Tree tree = new Tree(); List<Object> paths = new ArrayList<Object>(); paths.add("one"); paths.add(new String[] { "two", "three" }); tree.buildFromList(paths); List<Node> leafNodes = tree.getLeafNodes(); assertEquals("one/two", leafNodes.get(0).getPath()); assertEquals("one/three", leafNodes.get(1).getPath()); }