### Question:
RelationshipEndDef extends TypeDefElementHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof RelationshipEndDef)) { return false; } RelationshipEndDef that = (RelationshipEndDef) objectToCompare; return Objects.equals(getEntityType(), that.getEntityType()) && Objects.equals(getAttributeName(), that.getAttributeName()) && Objects.equals(getAttributeDescription(), that.getAttributeDescription()) && Objects.equals(getAttributeDescriptionGUID(), that.getAttributeDescriptionGUID()) && getAttributeCardinality() == that.getAttributeCardinality(); } RelationshipEndDef();  RelationshipEndDef(RelationshipEndDef template); TypeDefLink getEntityType(); void setEntityType(TypeDefLink entityType); String getAttributeName(); void setAttributeName(String attributeName); RelationshipEndCardinality getAttributeCardinality(); void setAttributeCardinality(RelationshipEndCardinality attributeCardinality); String getAttributeDescription(); void setAttributeDescription(String attributeDescription); String getAttributeDescriptionGUID(); void setAttributeDescriptionGUID(String attributeDescriptionGUID); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode();  }### Answer:
@Test public void testEquals() { assertTrue(getTestObject().equals(getTestObject())); RelationshipEndDef testObject = getTestObject(); assertTrue(testObject.equals(testObject)); assertTrue(testObject.equals(getTestObject())); assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("A String")); RelationshipEndDef differentObject = getTestObject(); differentObject.setAttributeName("AnotherValue"); assertFalse(testObject.equals(differentObject)); }