### Question:
ObjectClass extends AbstractSchemaObject { @Override public boolean equals( Object o ) { if ( !super.equals( o ) ) { return false; } if ( !( o instanceof ObjectClass ) ) { return false; } ObjectClass that = ( ObjectClass ) o; if ( objectClassType != that.objectClassType ) { return false; } if ( superiorOids.size() != that.superiorOids.size() ) { return false; } for ( String oid : superiorOids ) { if ( !that.superiorOids.contains( oid ) ) { return false; } } for ( String oid : that.superiorOids ) { if ( !superiorOids.contains( oid ) ) { return false; } } if ( superiors.size() != that.superiors.size() ) { return false; } for ( ObjectClass superior : superiors ) { if ( !that.superiors.contains( superior ) ) { return false; } } for ( ObjectClass superior : that.superiors ) { if ( !superiors.contains( superior ) ) { return false; } } if ( mayAttributeTypeOids.size() != that.mayAttributeTypeOids.size() ) { return false; } for ( String oid : mayAttributeTypeOids ) { if ( !that.mayAttributeTypeOids.contains( oid ) ) { return false; } } for ( String oid : that.mayAttributeTypeOids ) { if ( !mayAttributeTypeOids.contains( oid ) ) { return false; } } if ( mayAttributeTypes.size() != that.mayAttributeTypes.size() ) { return false; } for ( AttributeType oid : mayAttributeTypes ) { if ( !that.mayAttributeTypes.contains( oid ) ) { return false; } } for ( AttributeType oid : that.mayAttributeTypes ) { if ( !mayAttributeTypes.contains( oid ) ) { return false; } } if ( mustAttributeTypeOids.size() != that.mustAttributeTypeOids.size() ) { return false; } for ( String oid : mustAttributeTypeOids ) { if ( !that.mustAttributeTypeOids.contains( oid ) ) { return false; } } for ( String oid : that.mustAttributeTypeOids ) { if ( !mustAttributeTypeOids.contains( oid ) ) { return false; } } if ( mustAttributeTypes.size() != that.mustAttributeTypes.size() ) { return false; } for ( AttributeType oid : mustAttributeTypes ) { if ( !that.mustAttributeTypes.contains( oid ) ) { return false; } } for ( AttributeType oid : that.mustAttributeTypes ) { if ( !mustAttributeTypes.contains( oid ) ) { return false; } } return true; } ObjectClass( String oid ); List<String> getMayAttributeTypeOids(); List<AttributeType> getMayAttributeTypes(); void addMayAttributeTypeOids( String... oids ); void addMayAttributeTypes( AttributeType... attributeTypes ); void setMayAttributeTypeOids( List<String> mayAttributeTypeOids ); void setMayAttributeTypes( List<AttributeType> mayAttributeTypes ); List<String> getMustAttributeTypeOids(); List<AttributeType> getMustAttributeTypes(); void addMustAttributeTypeOids( String... oids ); void addMustAttributeTypes( AttributeType... attributeTypes ); void setMustAttributeTypeOids( List<String> mustAttributeTypeOids ); void setMustAttributeTypes( List<AttributeType> mustAttributeTypes ); List<ObjectClass> getSuperiors(); List<String> getSuperiorOids(); void addSuperiorOids( String... oids ); void addSuperior( ObjectClass... objectClasses ); void setSuperiors( List<ObjectClass> superiors ); void setSuperiorOids( List<String> superiorOids ); ObjectClassTypeEnum getType(); void setType( ObjectClassTypeEnum objectClassType ); boolean isStructural(); boolean isAbstract(); boolean isAuxiliary(); @Override String toString(); @Override ObjectClass copy(); @Override int hashCode(); @Override boolean equals( Object o ); @Override void clear(); static final long serialVersionUID; }### Answer:
@Test public void testEqualsNull() throws Exception { assertFalse( objectClassA.equals( null ) ); }
@Test public void testNotEqualDiffValue() throws Exception { assertFalse( objectClassA.equals( objectClassC ) ); assertFalse( objectClassC.equals( objectClassA ) ); }