Hierarchy implements Serializable { public Set<HierarchyNode> getTopLevelNodes() { return topLevelNodes; } 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 getTopLevelNodes() { Hierarchy clone = (Hierarchy) SerializationUtils.clone(hierarchy); Set<HierarchyNode> topLevelNodes = clone.getTopLevelNodes(); topLevelNodes.add(new HierarchyNode(new File(), null)); assertEquals(topLevelNodes.size(), clone.getTopLevelNodes().size()); }