@Test public void testDigest() { Authentication auth1 = new SecretAuthentication( "key", "value" ); Authentication auth2 = new SecretAuthentication( "key", "value" ); String digest1 = newDigest( auth1 ); String digest2 = newDigest( auth2 ); assertEquals( digest1, digest2 ); Authentication auth3 = new SecretAuthentication( "key", "Value" ); String digest3 = newDigest( auth3 ); assertFalse( digest3.equals( digest1 ) ); Authentication auth4 = new SecretAuthentication( "Key", "value" ); String digest4 = newDigest( auth4 ); assertFalse( digest4.equals( digest1 ) ); }
public void digest( AuthenticationDigest digest ) { char[] secret = copy( value ); try { xor( secret ); digest.update( key ); digest.update( secret ); } finally { clear( secret ); } }
SecretAuthentication implements Authentication { public void digest( AuthenticationDigest digest ) { char[] secret = copy( value ); try { xor( secret ); digest.update( key ); digest.update( secret ); } finally { clear( secret ); } } }
SecretAuthentication implements Authentication { public void digest( AuthenticationDigest digest ) { char[] secret = copy( value ); try { xor( secret ); digest.update( key ); digest.update( secret ); } finally { clear( secret ); } } SecretAuthentication( String key, String value );  SecretAuthentication( String key, char[] value ); private  SecretAuthentication( char[] value, String key ); }
SecretAuthentication implements Authentication { public void digest( AuthenticationDigest digest ) { char[] secret = copy( value ); try { xor( secret ); digest.update( key ); digest.update( secret ); } finally { clear( secret ); } } SecretAuthentication( String key, String value );  SecretAuthentication( String key, char[] value ); private  SecretAuthentication( char[] value, String key ); 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(); }
SecretAuthentication implements Authentication { public void digest( AuthenticationDigest digest ) { char[] secret = copy( value ); try { xor( secret ); digest.update( key ); digest.update( secret ); } finally { clear( secret ); } } SecretAuthentication( String key, String value );  SecretAuthentication( String key, char[] value ); private  SecretAuthentication( char[] value, String key ); 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();  }