FileEntry extends Entry { @Override public FileEntry copy() { return new FileEntry(myId, myName, myContent, myTimestamp, isReadOnly); } FileEntry(int id, String name, Content content, long timestamp, boolean isReadOnly);  FileEntry(Stream s); @Override void write(Stream s); @Override long getTimestamp(); @Override boolean isReadOnly(); @Override void setReadOnly(boolean isReadOnly); @Override Content getContent(); @Override boolean hasUnavailableContent(List<Entry> entriesWithUnavailableContent); @Override FileEntry copy(); @Override void changeContent(Content newContent, long newTimestamp); @Override void collectDifferencesWith(Entry e, List<Difference> result);  }
@Test public void testDoesNotCopyParent() { DirectoryEntry parent = new DirectoryEntry(-1, null); FileEntry file = new FileEntry(-1, null, null, -1, false); parent.addChild(file); Entry copy = file.copy(); assertNull(copy.getParent()); }