ProjectHistory extends OwnedEntity { public History getHistory() { return history; } ProjectHistory();  ProjectHistory(OwnedEntity entity, History history);  ProjectHistory(ProjectHistory project); History getHistory(); void setHistory(History history); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void constructorProjectInfoHistory() throws Exception { History history = new HistoryStub(); ProjectHistory another = new ProjectHistory(new OwnedEntityStub(), history); assertEquals("userId not same.", USER_ID, another.getUserId()); assertEquals("history not same.", history, another.getHistory()); assertNull("id must not be copied.", another.getId()); assertNull("version must not be copied.", another.getVersion()); }
@Test public void copyConstructor() { ProjectHistory another = new ProjectHistory(entity); assertEquals("userId not same.", entity.getUserId(), another .getUserId()); assertEquals("history not same.", entity.getHistory(), another .getHistory()); }