@Test public void testEquals() { Authentication auth1 = new StringAuthentication( "key", "value" ); Authentication auth2 = new StringAuthentication( "key", "value" ); Authentication auth3 = new StringAuthentication( "key", "Value" ); assertEquals( auth1, auth2 ); assertFalse( auth1.equals( auth3 ) ); assertFalse( auth1.equals( null ) ); }
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } StringAuthentication that = (StringAuthentication) obj; return eq( key, that.key ) && eq( value, that.value ); }
StringAuthentication implements Authentication { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } StringAuthentication that = (StringAuthentication) obj; return eq( key, that.key ) && eq( value, that.value ); } }
StringAuthentication implements Authentication { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } StringAuthentication that = (StringAuthentication) obj; return eq( key, that.key ) && eq( value, that.value ); } StringAuthentication( String key, String value ); }
StringAuthentication implements Authentication { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } StringAuthentication that = (StringAuthentication) obj; return eq( key, that.key ) && eq( value, that.value ); } StringAuthentication( String key, String value ); void fill( AuthenticationContext context, String key, Map<String, String> data ); void digest( AuthenticationDigest digest ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override String toString(); }
StringAuthentication implements Authentication { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } StringAuthentication that = (StringAuthentication) obj; return eq( key, that.key ) && eq( value, that.value ); } StringAuthentication( String key, String value ); void fill( AuthenticationContext context, String key, Map<String, String> data ); void digest( AuthenticationDigest digest ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override String toString();  }