### Question:
AbstractResultResponse extends AbstractResponse implements ResultResponse { @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( !super.equals( obj ) ) { return false; } if ( !( obj instanceof ResultResponse ) ) { return false; } ResultResponse resp = ( ResultResponse ) obj; return ( ( ldapResult != null ) && ldapResult.equals( resp.getLdapResult() ) ) || ( resp.getLdapResult() == null ); } protected  AbstractResultResponse( final int id, final MessageTypeEnum type ); @Override LdapResult getLdapResult(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString();  }### Answer:
@Test public void testEqualsSameObj() { AbstractResultResponse msg; msg = new AbstractResultResponse( 5, MessageTypeEnum.BIND_REQUEST ) { }; assertTrue( msg.equals( msg ) ); }
@Test public void testNotEqualsDiffId() { AbstractResultResponse msg0; AbstractResultResponse msg1; msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BIND_REQUEST ) { }; msg1 = new AbstractResultResponse( 6, MessageTypeEnum.BIND_REQUEST ) { }; assertFalse( msg0.equals( msg1 ) ); assertFalse( msg1.equals( msg0 ) ); }
@Test public void testNotEqualsDiffType() { AbstractResultResponse msg0; AbstractResultResponse msg1; msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BIND_REQUEST ) { }; msg1 = new AbstractResultResponse( 5, MessageTypeEnum.UNBIND_REQUEST ) { }; assertFalse( msg0.equals( msg1 ) ); assertFalse( msg1.equals( msg0 ) ); }
@Test public void testNotEqualsDiffControls() { AbstractResultResponse msg0; AbstractResultResponse msg1; msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BIND_REQUEST ) { }; msg0.addControl( new Control() { public boolean isCritical() { return false; } public void setCritical( boolean isCritical ) { } public String getOid() { return "0.0"; } } ); msg1 = new AbstractResultResponse( 5, MessageTypeEnum.BIND_REQUEST ) { }; assertFalse( msg0.equals( msg1 ) ); assertFalse( msg1.equals( msg0 ) ); }