### Question:
RelationshipDef extends TypeDef { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof RelationshipDef)) { return false; } if (!super.equals(objectToCompare)) { return false; } RelationshipDef that = (RelationshipDef) objectToCompare; return getPropagationRule() == that.getPropagationRule() && Objects.equals(getEndDef1(), that.getEndDef1()) && Objects.equals(getEndDef2(), that.getEndDef2()); } RelationshipDef();  RelationshipDef(TypeDefCategory category,
                           String          guid,
                           String          name,
                           long            version,
                           String          versionName);  RelationshipDef(RelationshipDef templateTypeDef); TypeDef cloneFromSubclass(); ClassificationPropagationRule getPropagationRule(); void setPropagationRule(ClassificationPropagationRule propagationRule); RelationshipEndDef getEndDef1(); void setEndDef1(RelationshipEndDef endDef1); RelationshipEndDef getEndDef2(); void setEndDef2(RelationshipEndDef endDef2); @Override String toString(); @Override boolean equals(Object objectToCompare);  }### Answer:
@Test public void testEquals() { assertTrue(getTestObject().equals(getTestObject())); RelationshipDef testObject = getTestObject(); assertTrue(testObject.equals(testObject)); assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("A String")); RelationshipDef differentObject = new RelationshipDef(TypeDefCategory.ENTITY_DEF, guid, name, 0 , "1.0"); assertFalse(testObject.equals(differentObject)); differentObject = getTestObject(); differentObject.setVersionName("DifferentHomeId"); assertFalse(testObject.equals(differentObject)); }