HierarchyNode implements Serializable { public File getFile() { return file; } HierarchyNode(File file, HierarchyNode parent); void addDependency(HierarchyNode node); void addMissingDependency(String name); boolean hasDependencies(); File getFile(); Set<File> getDependencies(); Set<String> getMissingDependencies(); boolean containsDependency(File dependency); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void getFile() { File file = root.getFile(); file.setName("name"); assertEquals("name", root.getFile().getName()); }
@Test public void hashCodeAndEquals() throws Exception { basicEqualsTest(root); HierarchyNode newRoot = new HierarchyNode(new File(), null); HierarchyNode another = new HierarchyNode(root.getFile(), newRoot); assertEqualsAndHashCode(root, another); another = new HierarchyNode(new File("another_file", null, null), newRoot); assertNotEqualsAndHashCode(root, another); }