    @Test public void testCancelWhenError() throws Exception {

        mFacebookSubscriber.subscribe(mEmitter);
        when(mEmitter.isCancelled()).thenReturn(true);
        mFacebookSubscriber.mCallback.onError(new FacebookException());
        verify(mEmitter, never()).onError(any(Throwable.class));
        verify(mEmitter, never()).onNext(any(LoginResult.class));
        verify(mEmitter, never()).onComplete();
    }