void () { Entry dir = new DirectoryEntry(null); Entry child1 = new FileEntry("child1", null, -1, false); Entry child2 = new DirectoryEntry("child2"); Entry child3 = new FileEntry("child3", null, -1, false); dir.addChild(child1); dir.addChild(child2); child2.addChild(child3); dir.copy(); assertSame(dir, child1.getParent()); assertSame(dir, child2.getParent()); assertSame(child2, child3.getParent()); }