### Question:
TokenValidationConfig { @Override public boolean equals(Object other) { if (other instanceof TokenValidationConfig) { TokenValidationConfig otherConfig = (TokenValidationConfig)other; return validatedTokenType.equals(otherConfig.getValidatedTokenType()) && (invalidateInterimOpenAMSession == otherConfig.invalidateInterimOpenAMSession()); } return false; } TokenValidationConfig(TokenType validatedTokenType, boolean invalidateInterimOpenAMSession); boolean invalidateInterimOpenAMSession(); TokenType getValidatedTokenType(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); JsonValue toJson(); static TokenValidationConfig fromJson(JsonValue json); String toSMSString(); static TokenValidationConfig fromSMSString(String stringRepresentation);  }### Answer:
@Test public void testEquals() { TokenValidationConfig tvc1 = new TokenValidationConfig(TokenType.OPENAM, AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); TokenValidationConfig tvc2 = new TokenValidationConfig(TokenType.OPENAM, AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); assertEquals(tvc1, tvc2); assertEquals(tvc1.hashCode(), tvc2.hashCode()); tvc1 = new TokenValidationConfig(TokenType.OPENAM, !AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); tvc2 = new TokenValidationConfig(TokenType.OPENAM, !AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); assertEquals(tvc1, tvc2); assertEquals(tvc1.hashCode(), tvc2.hashCode()); tvc1 = new TokenValidationConfig(TokenType.USERNAME, AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); tvc2 = new TokenValidationConfig(TokenType.USERNAME, AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); assertEquals(tvc1, tvc2); assertEquals(tvc1.hashCode(), tvc2.hashCode()); tvc1 = new TokenValidationConfig(TokenType.USERNAME, !AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); tvc2 = new TokenValidationConfig(TokenType.USERNAME, !AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); assertEquals(tvc1, tvc2); assertEquals(tvc1.hashCode(), tvc2.hashCode()); tvc1 = new TokenValidationConfig(TokenType.X509, AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); tvc2 = new TokenValidationConfig(TokenType.X509, AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); assertEquals(tvc1, tvc2); assertEquals(tvc1.hashCode(), tvc2.hashCode()); tvc1 = new TokenValidationConfig(TokenType.X509, !AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); tvc2 = new TokenValidationConfig(TokenType.X509, !AMSTSConstants.INVALIDATE_INTERIM_OPENAM_SESSION); assertEquals(tvc1, tvc2); assertEquals(tvc1.hashCode(), tvc2.hashCode()); }