@Test public void testHashCode() { Authentication auth1 = new SecretAuthentication( "key", "value" ); Authentication auth2 = new SecretAuthentication( "key", "value" ); assertEquals( auth1.hashCode(), auth2.hashCode() ); }
@Override public int hashCode() { int hash = 17; hash = hash * 31 + key.hashCode(); hash = hash * 31 + secretHash; return hash; }
SecretAuthentication implements Authentication { @Override public int hashCode() { int hash = 17; hash = hash * 31 + key.hashCode(); hash = hash * 31 + secretHash; return hash; } }
SecretAuthentication implements Authentication { @Override public int hashCode() { int hash = 17; hash = hash * 31 + key.hashCode(); hash = hash * 31 + secretHash; return hash; } SecretAuthentication( String key, String value );  SecretAuthentication( String key, char[] value ); private  SecretAuthentication( char[] value, String key ); }
SecretAuthentication implements Authentication { @Override public int hashCode() { int hash = 17; hash = hash * 31 + key.hashCode(); hash = hash * 31 + secretHash; return hash; } 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 { @Override public int hashCode() { int hash = 17; hash = hash * 31 + key.hashCode(); hash = hash * 31 + secretHash; return hash; } 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();  }