Hierarchy implements Serializable { public Project getProject() { return project; } 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 public void hashCodeAndEquals() throws Exception { basicEqualsTest(hierarchy); Hierarchy another = new Hierarchy(hierarchy.getProject(), collection); assertEqualsAndHashCode(hierarchy, another); another = new Hierarchy(new Project("newUserId", "another_name"), collection); assertNotEqualsAndHashCode(hierarchy, another); }
@Test public void getProject() { Project project = hierarchy.getProject(); project.setName("another_name"); assertEquals("another_name", hierarchy.getProject().getName()); }