### Question:
TreatmentDefinition extends AbstractEntity implements Comparable<TreatmentDefinition> { @Override public boolean equals(Object o) { if (o == null || !(o instanceof TreatmentDefinition)) { return false; } TreatmentDefinition other = (TreatmentDefinition) o; return other.getContents().equals(getContents()); } TreatmentDefinition(Category category);  TreatmentDefinition(Collection<Category> contents);  TreatmentDefinition(); static TreatmentDefinition createTrivial(Collection<Drug> drugs); static TreatmentDefinition createTrivial(Drug drug); @Override Set<? extends Entity> getDependencies(); SortedSet<Category> getContents(); String getLabel(); @Override boolean equals(Object o); @Override boolean deepEquals(Entity o); @Override int hashCode(); @Override int compareTo(TreatmentDefinition o); @Override String toString(); boolean match(TreatmentActivity act); boolean match(Study study, Arm arm);  }### Answer:
@Test public void testEquals() { assertEquals(new TreatmentDefinition(), d_empty); assertEquals(new TreatmentDefinition().hashCode(), d_empty.hashCode()); assertEquals(new TreatmentDefinition(d_singleCategory), d_single); assertEquals(new TreatmentDefinition(d_singleCategory).hashCode(), d_single.hashCode()); assertEquals(new TreatmentDefinition(d_multiCategory), d_multi); assertEquals(new TreatmentDefinition(d_multiCategory).hashCode(), d_multi.hashCode()); assertNotEquals(d_empty, d_single); assertNotEquals(d_empty, d_multi); assertNotEquals(d_single, d_multi); assertNotEquals(d_empty, null); assertNotEquals(d_empty, new Object()); }