### Question:
BindResponseImpl extends AbstractResultResponse implements BindResponse { @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( !( obj instanceof BindResponse ) ) { return false; } if ( !super.equals( obj ) ) { return false; } BindResponse response = ( BindResponse ) obj; byte[] creds = response.getServerSaslCreds(); if ( serverSaslCreds == null ) { if ( creds != null ) { return false; } } else if ( creds == null ) { return false; } return Arrays.equals( serverSaslCreds, creds ); } BindResponseImpl();  BindResponseImpl( final int id ); @Override byte[] getServerSaslCreds(); @Override void setServerSaslCreds( byte[] serverSaslCreds ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString();  }### Answer:
@Test public void testEqualsSameObj() { BindResponseImpl resp = new BindResponseImpl( 1 ); assertTrue( resp.equals( resp ), "same object should be equal" ); }
@Test public void testEqualsNewWithSameId() { BindResponseImpl resp0 = new BindResponseImpl( 1 ); BindResponseImpl resp1 = new BindResponseImpl( 1 ); assertTrue( resp0.equals( resp1 ), "default copy with same id should be equal" ); assertTrue( resp1.equals( resp0 ), "default copy with same id should be equal" ); }
@Test public void testNotEqualsNewWithDiffId() { BindResponseImpl resp0 = new BindResponseImpl( 1 ); BindResponseImpl resp1 = new BindResponseImpl( 2 ); assertFalse( resp0.equals( resp1 ), "different id objects should not be equal" ); assertFalse( resp1.equals( resp0 ), "different id objects should not be equal" ); }