### Question:
StudyActivity extends AbstractNamedEntity<StudyActivity> implements TypeWithNotes { public boolean isComplete() { if (d_activity == null) { return false; } if (d_activity instanceof TreatmentActivity) { TreatmentActivity ta = (TreatmentActivity) d_activity; return ta.isComplete(); } return true; } StudyActivity(String name, Activity activity); @Override Set<? extends Entity> getDependencies(); void setActivity(Activity activity); Activity getActivity(); void setUsedBy(Set<UsedBy> usedBy); Set<UsedBy> getUsedBy(); ObservableList<Note> getNotes(); boolean deepEquals(Entity obj); @Override boolean equals(Object obj); @Override StudyActivity clone(); boolean isComplete(); void setName(String name); static final String PROPERTY_ACTIVITY; static final String PROPERTY_USED_BY; }### Answer:
@Test public void testIsComplete() { assertFalse(d_undefined.isComplete()); assertTrue(d_randomization.isComplete()); assertTrue(d_main.isComplete()); d_main.setActivity(new TreatmentActivity(new DrugTreatment(null, new FixedDose(10.0, DoseUnit.createMilliGramsPerDay())))); assertFalse(d_main.isComplete()); d_main.setActivity(new TreatmentActivity(new DrugTreatment(d_fluoxetine, null))); assertFalse(d_main.isComplete()); }