### Question:
OAuth2Session { OAuth2Session stateRefreshed(final JsonValue refreshTokenResponse) throws OAuth2ErrorException { return stateAuthorized(refreshTokenResponse); } private  OAuth2Session(final TimeService time, final String clientRegistrationName,
            final String clientEndpoint, final String authorizationRequestNonce,
            final List<String> scopes, final JsonValue accessTokenResponse,
            final SignedJwt idToken, final Long expiresAt);   }### Answer:
@Test public void testStateRefreshed() throws Exception { when(time.now()).thenReturn(1000L, 2000L, 3000L); JsonValue accessTokenResponse = json(object( field("access_token", "at"), field("refresh_token", "rt"), field("token_type", "tt"), field("expires_in", 3600), field("id_token", idToken) )); JsonValue refreshAccessTokenResponse = json(object( field("access_token", "at2"), field("refresh_token", "rt2"), field("token_type", "tt"), field("scope", "one two three"), field("expires_in", 1000), field("id_token", idToken) )); OAuth2Session session = OAuth2Session.stateNew(time) .stateAuthorizing("clientRegistration", "endpoint", "nonce", asList("scope1", "scope2")) .stateAuthorized(accessTokenResponse) .stateRefreshed(refreshAccessTokenResponse); testStateRefreshed0(session, refreshAccessTokenResponse); session = OAuth2Session.fromJson(time, session.toJson()); testStateRefreshed0(session, refreshAccessTokenResponse); }