File extends FileInfo { public void setProject(Project project) { if (project == null) { setPostRemoveProjectReference(this.project); } this.project = project; } File();  File(String name, FileType type, String data);  File(File clone);  File(File clone, boolean setProjectReference);  File(File clone, Project project); @NameFormatConstraint @Override String getName(); Project getProject(); void setProject(Project project); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void setProject() { Project anotherProject = new ProjectStub2(); entity.setProject(anotherProject); assertEquals("projects not same.", anotherProject, entity.getProject()); assertNull("post remove project reference not null.", entity .getPostRemoveProjectReference()); entity.setProject(null); assertNull("project not null.", entity.getProject()); assertEquals("post remove project reference not set.", anotherProject, entity.getPostRemoveProjectReference()); }