Project extends OwnedEntity { public void setFiles(Set<File> files) { this.files = files; } Project();  Project(String name);  Project(String userId, String name);  Project(Project clone); @NameFormatConstraint @Override String getName(); Set<File> getFiles(); void setFiles(Set<File> files); void addFile(File file); void removeFile(File file); @Override String toString();  }
@Test public void setFiles() throws Exception { entity = new Project(); assertTrue("files not empty.", entity.getFiles().isEmpty()); entity.getFiles().add(new FileStub()); assertFalse("files is empty.", entity.getFiles().isEmpty()); entity = new Project(); Set<File> files = new HashSet<File>(); entity.setFiles(files); assertTrue("files not empty.", entity.getFiles().isEmpty()); files.add(new FileStub()); assertFalse("files is empty.", entity.getFiles().isEmpty()); }