### Question:
StudyActivity extends AbstractNamedEntity<StudyActivity> implements TypeWithNotes { @Override public StudyActivity clone() { StudyActivity cloned = new StudyActivity(getName(), cloneActivity()); cloned.setUsedBy(getUsedBy()); cloned.d_notes.addAll(d_notes); return cloned; } 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 testClone() { assertTrue(d_main.deepEquals(d_main.clone())); assertNotSame(d_main, d_main.clone()); assertNotSame(d_main.getActivity(), d_main.clone().getActivity()); assertNotSame(d_main.getUsedBy(), d_main.clone().getUsedBy()); assertEquals(Collections.emptyList(), d_main.getNotes()); assertNotSame(d_main.getNotes(), d_main.clone().getNotes()); d_main.getNotes().add(new Note()); assertTrue(d_main.deepEquals(d_main.clone())); }