### Question:
TreatmentActivity extends AbstractEntity implements Activity { @Override public boolean equals(Object obj) { if (obj != null && obj instanceof TreatmentActivity) { TreatmentActivity other = (TreatmentActivity) obj; return EqualsUtil.equal(other.getTreatments(), getTreatments()); } return false; } TreatmentActivity();  TreatmentActivity(DrugTreatment ta);  TreatmentActivity(List<DrugTreatment> treatments); @Override Set<? extends Entity> getDependencies(); @Override String getLabel(); void addTreatment(Drug drug, AbstractDose dose); @Override boolean equals(Object obj); ObservableList<DrugTreatment> getTreatments(); @Override String toString(); boolean isComplete(); static final String PROPERTY_TREATMENTS; }### Answer:
@Test public void testEquals() { assertEquals(new TreatmentActivity(), d_empty); TreatmentActivity ct = new TreatmentActivity(); ct.addTreatment(new Drug("Fluoxetine", "N06AB12"), new FixedDose(12.0, DoseUnit.createMilliGramsPerDay())); JUnitUtil.assertNotEquals(ct, d_orig); ct.addTreatment(new Drug("Paroxetine", "N062"), new FlexibleDose(new Interval<Double>(3.0, 7.0), DoseUnit.createMilliGramsPerDay())); assertEquals(ct, d_orig); JUnitUtil.assertNotEquals(d_empty, d_orig); }