### Question:
RestSTSTokenValidationInvocationState { @Override public boolean equals(Object other) { if (other instanceof RestSTSTokenValidationInvocationState) { RestSTSTokenValidationInvocationState otherState = (RestSTSTokenValidationInvocationState)other; return validatedTokenState.toString().equals(otherState.validatedTokenState.toString()); } return false; } private  RestSTSTokenValidationInvocationState(RestSTSTokenValidationInvocationStateBuilder builder); static RestSTSTokenValidationInvocationStateBuilder builder(); JsonValue getValidatedTokenState(); JsonValue toJson(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); static RestSTSTokenValidationInvocationState fromJson(JsonValue jsonValue); static final String VALIDATED_TOKEN_STATE; }### Answer:
@Test public void testEquals() throws TokenMarshalException { SAML2TokenState saml2TokenState = SAML2TokenState.builder().tokenValue(SAML2_ASSERTION).build(); RestSTSTokenValidationInvocationState invocationState = RestSTSTokenValidationInvocationState.builder().validatedTokenState(saml2TokenState.toJson()).build(); RestSTSTokenValidationInvocationState invocationState2 = RestSTSTokenValidationInvocationState.builder().validatedTokenState(saml2TokenState.toJson()).build(); assertEquals(invocationState, invocationState2); OpenIdConnectTokenState openIdConnectTokenState = OpenIdConnectTokenState.builder().tokenValue(OIDC_TOKEN).build(); invocationState = RestSTSTokenValidationInvocationState.builder().validatedTokenState(openIdConnectTokenState.toJson()).build(); invocationState2 = RestSTSTokenValidationInvocationState.builder().validatedTokenState(openIdConnectTokenState.toJson()).build(); assertEquals(invocationState, invocationState2); invocationState = RestSTSTokenValidationInvocationState.builder().validatedTokenState(openIdConnectTokenState.toJson()).build(); invocationState2 = RestSTSTokenValidationInvocationState.builder().validatedTokenState(saml2TokenState.toJson()).build(); assertNotEquals(invocationState, invocationState2); }