### Question:
CollectionDef extends AttributeTypeDef { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof CollectionDef)) { return false; } if (!super.equals(objectToCompare)) { return false; } CollectionDef that = (CollectionDef) objectToCompare; return getArgumentCount() == that.getArgumentCount() && getCollectionDefCategory() == that.getCollectionDefCategory() && Objects.equals(getArgumentTypes(), that.getArgumentTypes()); } CollectionDef();  CollectionDef(CollectionDefCategory  collectionDefCategory);  CollectionDef(CollectionDef template); AttributeTypeDef cloneFromSubclass(); CollectionDefCategory getCollectionDefCategory(); void setCollectionDefCategory(CollectionDefCategory collectionDefCategory); int getArgumentCount(); void setArgumentCount(int argumentCount); List<PrimitiveDefCategory> getArgumentTypes(); void setArgumentTypes(List<PrimitiveDefCategory> argumentTypes); @Override String toString(); @Override boolean equals(Object objectToCompare);  }### Answer:
@Test public void testEquals() { assertTrue(getTestObject().equals(getTestObject())); CollectionDef testObject = getTestObject(); assertTrue(testObject.equals(testObject)); testObject.setDescription("NewDescription"); assertFalse(getTestObject().equals(testObject)); assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("AString")); }