### Question:
AuthorizationCodeResponseTypeHandler implements ResponseTypeHandler { public Map.Entry<String, Token> handle(String tokenType, Set<String> scope, ResourceOwner resourceOwner, String clientId, String redirectUri, String nonce, OAuth2Request request, String codeChallenge, String codeChallengeMethod) throws ServerException, NotFoundException { final AuthorizationCode authorizationCode = tokenStore.createAuthorizationCode(scope, resourceOwner, clientId, redirectUri, nonce, request, codeChallenge, codeChallengeMethod); return new AbstractMap.SimpleEntry<String, Token>(OAuth2Constants.Params.CODE, authorizationCode); } @Inject  AuthorizationCodeResponseTypeHandler(TokenStore tokenStore); Map.Entry<String, Token> handle(String tokenType, Set<String> scope,
                                           ResourceOwner resourceOwner, String clientId, String redirectUri,
                                           String nonce, OAuth2Request request, String codeChallenge,
                                           String codeChallengeMethod); OAuth2Constants.UrlLocation getReturnLocation();  }### Answer:
@Test public void shouldHandle() throws Exception { String tokenType = "TOKEN_TYPE"; Set<String> scope = new HashSet<String>(); ResourceOwner resourceOwner = mock(ResourceOwner.class); String clientId = "CLIENT_ID"; String redirectUri = "REDIRECT_URI"; String nonce = "NONCE"; OAuth2Request request = mock(OAuth2Request.class); AuthorizationCode authorizationCode = mock(AuthorizationCode.class); given(tokenStore.createAuthorizationCode(scope, resourceOwner, clientId, redirectUri, nonce, request, null, null)) .willReturn(authorizationCode); final Map.Entry<String, Token> tokenEntry = responseTypeHandler.handle(tokenType, scope, resourceOwner, clientId, redirectUri, nonce, request, null, null); assertEquals(tokenEntry.getKey(), "code"); assertEquals(tokenEntry.getValue(), authorizationCode); }