    public void test_handle_implies_call_to_authenticationSchemeHandler_when_authentication_succeed() throws Exception {
        MockRequestAdapter request = new MockRequestAdapter(new MockRequest());
        MockResponseAdapter response = new MockResponseAdapter(new MockResponse());
        AuthenticationSchemeHandler<MockRequestAdapter, MockResponseAdapter> authenticationSchemeHandler = mock(AuthenticationSchemeHandler.class);
        Collection<Class<? extends Callback>> callbackClasses = Lists.newArrayList();
        callbackClasses.add(NameCallback.class);
        when(authenticationSchemeHandler.getCallbackTypes()).thenReturn(callbackClasses);
        Collection<AuthenticationSchemeHandler<MockRequestAdapter, MockResponseAdapter>> authenticationSchemeHandlers = new ArrayList<AuthenticationSchemeHandler<MockRequestAdapter, MockResponseAdapter>>();
        authenticationSchemeHandlers.add(authenticationSchemeHandler);
        MockCallbackHandler mockCallbackHandler = new MockCallbackHandler(new MockRequestAdapter(new MockRequest()), new MockResponseAdapter(new MockResponse()), authenticationSchemeHandlers
        );
        List<Callback> callbackList = new ArrayList<Callback>();
        NameCallback nameCallback = new NameCallback(DUMMY_PROMPT);
        callbackList.add(nameCallback);
        Callback[] callbacks = callbackList.toArray(new Callback[callbackList.size()]);
        mockCallbackHandler.handle(callbacks);
        Subject subject = new Subject();
        mockCallbackHandler.authenticationSucceed(subject);
        verify(authenticationSchemeHandler).authenticationSucceed(subject, request, response);
    }

    public void test_handle_implies_call_to_authenticationSchemeHandler_when_authentication_succeed() throws Exception {
        MockRequestAdapter request = new MockRequestAdapter(new MockRequest());
        MockResponseAdapter response = new MockResponseAdapter(new MockResponse());
        AuthenticationSchemeHandler<MockRequestAdapter, MockResponseAdapter> authenticationSchemeHandler = mock(AuthenticationSchemeHandler.class);
        Collection<Class<? extends Callback>> callbackClasses = Lists.newArrayList();
        callbackClasses.add(NameCallback.class);
        when(authenticationSchemeHandler.getCallbackTypes()).thenReturn(callbackClasses);
        Collection<AuthenticationSchemeHandler<MockRequestAdapter, MockResponseAdapter>> authenticationSchemeHandlers = new ArrayList<AuthenticationSchemeHandler<MockRequestAdapter, MockResponseAdapter>>();
        authenticationSchemeHandlers.add(authenticationSchemeHandler);
        MockCallbackHandler mockCallbackHandler = new MockCallbackHandler(request, response, authenticationSchemeHandlers
        );
        List<Callback> callbackList = new ArrayList<Callback>();
        NameCallback nameCallback = new NameCallback(DUMMY_PROMPT);
        callbackList.add(nameCallback);
        Callback[] callbacks = callbackList.toArray(new Callback[callbackList.size()]);
        mockCallbackHandler.handle(callbacks);
        Subject subject = new Subject();
        mockCallbackHandler.authenticationSucceed(subject);
        verify(authenticationSchemeHandler).authenticationSucceed(subject, request, response);
    }
