### Question:
AuthenticationResultHandler { public void setAuthenticationListener(AuthResultListener listener) { mResultListener = listener; postResult(); } private  AuthenticationResultHandler(); static AuthenticationResultHandler handler(); void setAuthenticationListener(AuthResultListener listener); void onActivityResult(int requestCode, int resultCode, Intent data); @VisibleForTesting
    public AuthResultListener mResultListener; @VisibleForTesting
    public StateResult mCachedResult; @VisibleForTesting
    public ResultType mCachedResultType; }### Answer:
@Test public void setAuthenticationListener() throws InterruptedException { AuthenticationResultHandler.handler().mCachedResult = StateResult.canceled(); AuthenticationResultHandler.handler().mCachedResultType = ResultType.SIGN_IN; final StateResult[] resultFromListener = new StateResult[1]; final ResultType[] typeFromListener = new ResultType[1]; CountDownLatch latch = new CountDownLatch(1); AuthResultListener listener = (result, type) -> { resultFromListener[0] = result; typeFromListener[0] = type; latch.countDown(); }; AuthenticationResultHandler.handler().setAuthenticationListener(listener); latch.await(); assertEquals(resultFromListener[0].getStatus(), CANCELED); assertEquals(typeFromListener[0], ResultType.SIGN_IN); assertNull(AuthenticationResultHandler.handler().mCachedResult); assertNull(AuthenticationResultHandler.handler().mCachedResultType); }