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