### Question:
PrimitiveDef extends AttributeTypeDef { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } if (!super.equals(objectToCompare)) { return false; } PrimitiveDef that = (PrimitiveDef) objectToCompare; return primitiveDefCategory == that.primitiveDefCategory; } PrimitiveDef();  PrimitiveDef(PrimitiveDefCategory  primitiveDefCategory);  PrimitiveDef(PrimitiveDef template); AttributeTypeDef cloneFromSubclass(); PrimitiveDefCategory getPrimitiveDefCategory(); void setPrimitiveDefCategory(PrimitiveDefCategory primitiveDefCategory); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode();  }### Answer:
@Test public void testEquals() { assertTrue(getTestObject().equals(getTestObject())); AttributeTypeDef testObject = getTestObject(); assertTrue(testObject.equals(testObject)); testObject.setName("Freddy"); assertFalse(getTestObject().equals(testObject)); assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("AString")); assertFalse(getTestObject().equals(new CollectionDef())); }