Hierarchy implements Serializable { public HierarchyNode getNode(File file) { Validate.notNull(file); return nodes.get(new File(file)); } Hierarchy(Project project, Collection<HierarchyNode> collection); Project getProject(); HierarchyNode getNode(File file); int getFileCount(); boolean fileHasDependency(File file, File dependency); Collection<HierarchyNode> getAllNodes(); Set<HierarchyNode> getTopLevelNodes(); Set<HierarchyNode> getBottomLevelNodes(); Set<HierarchyNode> getDependenciesFor(HierarchyNode node); Set<HierarchyNode> getParentsFor(HierarchyNode node); Iterator<HierarchyNode> iteratorFlatHierarchy(); Iterator<HierarchyNode> iteratorXUsesYHierarchy(HierarchyNode node); Iterator<HierarchyNode> iteratorXUsedByYHierarchy(HierarchyNode node); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void getNodeNullArgument() { hierarchy.getNode(null); }
@Test public void getNode() { assertEquals(root, hierarchy.getNode(root.getFile())); assertEquals(left, hierarchy.getNode(left.getFile())); assertEquals(right, hierarchy.getNode(right.getFile())); assertEquals(rightDep, hierarchy.getNode(rightDep.getFile())); File clone = new File(root.getFile(), new Project("userId", "a_project_name")); assertEquals(root, hierarchy.getNode(clone)); }