### Question:
SessionClientImpl implements SessionClient { public void revokeToken(String token, final RequestCallback<Boolean, AuthorizationException> cb) { cancelFuture(); mFutureTask = mDispatcher.submit(() -> { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); try { Boolean isRevoke = mSyncSessionClient.revokeToken(token); mDispatcher.submitResults(() -> cb.onSuccess(isRevoke)); } catch (AuthorizationException ae) { mDispatcher.submitResults(() -> cb.onError(ae.error, ae)); } catch (Exception ex) { mDispatcher.submitResults(() -> cb.onError(ex.getMessage(), new AuthorizationException(ex.getMessage(), ex))); } }); } SessionClientImpl(Executor callbackExecutor, SyncSessionClient syncSessionClient); void getUserProfile(final RequestCallback<UserInfo, AuthorizationException> cb); void introspectToken(String token, String tokenType,
                                final RequestCallback<IntrospectInfo, AuthorizationException> cb); void revokeToken(String token,
                            final RequestCallback<Boolean, AuthorizationException> cb); void refreshToken(final RequestCallback<Tokens, AuthorizationException> cb); @Override Tokens getTokens(); @Override void authorizedRequest(@NonNull Uri uri, @Nullable Map<String, String> properties,
                                  @Nullable Map<String, String> postParameters,
                                  @NonNull ConnectionParameters.RequestMethod method,
                                  final RequestCallback<JSONObject, AuthorizationException> cb); boolean isAuthenticated(); void clear(); @Override void cancel(); @Override void migrateTo(EncryptionManager manager);  }### Answer:
@Test public void revokeToken() throws InterruptedException { mEndPoint.enqueueReturnSuccessEmptyBody(); final CountDownLatch latch = new CountDownLatch(1); MockRequestCallback<Boolean, AuthorizationException> cb = new MockRequestCallback<>(latch); mSessionClient.revokeToken("access_token", cb); RecordedRequest recordedRequest = mEndPoint.takeRequest(); latch.await(); assertNotNull(cb.getResult()); assertTrue(cb.getResult()); assertThat(recordedRequest.getPath(), equalTo("/revoke?client_id=CLIENT_ID&token=access_token")); }
@Test public void revokeTokenFailure() throws InterruptedException { mEndPoint.enqueueReturnInvalidClient(); final CountDownLatch latch = new CountDownLatch(1); MockRequestCallback<Boolean, AuthorizationException> cb = new MockRequestCallback<>(latch); mSessionClient.revokeToken("access_token", cb); RecordedRequest recordedRequest = mEndPoint.takeRequest(); latch.await(); assertNull(cb.getResult()); assertNotNull(cb.getException()); assertEquals(TYPE_OAUTH_TOKEN_ERROR, cb.getException().type); assertThat(recordedRequest.getPath(), equalTo("/revoke?client_id=CLIENT_ID&token=access_token")); }