@Test public void testEqualsSameObject() { ReferralImpl refs = new ReferralImpl(); assertTrue( refs.equals( refs ), "equals method should work for the same object" ); }
@Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( obj instanceof Referral ) { Collection<String> refs = ( ( Referral ) obj ).getLdapUrls(); if ( refs.size() != urls.size() ) { return false; } Iterator<String> list = urls.iterator(); while ( list.hasNext() ) { if ( !refs.contains( list.next() ) ) { return false; } } return true; } return false; }
ReferralImpl implements Referral { @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( obj instanceof Referral ) { Collection<String> refs = ( ( Referral ) obj ).getLdapUrls(); if ( refs.size() != urls.size() ) { return false; } Iterator<String> list = urls.iterator(); while ( list.hasNext() ) { if ( !refs.contains( list.next() ) ) { return false; } } return true; } return false; } }
ReferralImpl implements Referral { @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( obj instanceof Referral ) { Collection<String> refs = ( ( Referral ) obj ).getLdapUrls(); if ( refs.size() != urls.size() ) { return false; } Iterator<String> list = urls.iterator(); while ( list.hasNext() ) { if ( !refs.contains( list.next() ) ) { return false; } } return true; } return false; }  }
ReferralImpl implements Referral { @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( obj instanceof Referral ) { Collection<String> refs = ( ( Referral ) obj ).getLdapUrls(); if ( refs.size() != urls.size() ) { return false; } Iterator<String> list = urls.iterator(); while ( list.hasNext() ) { if ( !refs.contains( list.next() ) ) { return false; } } return true; } return false; }  @Override int getReferralLength(); @Override void setReferralLength( int referralLength ); @Override Collection<String> getLdapUrls(); @Override Collection<byte[]> getLdapUrlsBytes(); @Override void addLdapUrl( String url ); @Override void addLdapUrlBytes( byte[] urlBytes ); @Override void removeLdapUrl( String url ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); }
ReferralImpl implements Referral { @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } if ( obj instanceof Referral ) { Collection<String> refs = ( ( Referral ) obj ).getLdapUrls(); if ( refs.size() != urls.size() ) { return false; } Iterator<String> list = urls.iterator(); while ( list.hasNext() ) { if ( !refs.contains( list.next() ) ) { return false; } } return true; } return false; }  @Override int getReferralLength(); @Override void setReferralLength( int referralLength ); @Override Collection<String> getLdapUrls(); @Override Collection<byte[]> getLdapUrlsBytes(); @Override void addLdapUrl( String url ); @Override void addLdapUrlBytes( byte[] urlBytes ); @Override void removeLdapUrl( String url ); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString();  }