AuthState { public void endAuthorize() { authHandlerRef.set(null); }  boolean beginAuthorize(Activity activity, AuthHandler authHandler); void endAuthorize(); boolean isAuthorizeInProgress(); AuthHandler getAuthHandler();  }
@Test public void testEndAuthorize() { final AuthState authState = new AuthState(); final boolean result = authState.beginAuthorize(mockActivity, mockAuthHandler); assertTrue(result); assertTrue(authState.isAuthorizeInProgress()); assertEquals(mockAuthHandler, authState.getAuthHandler()); authState.endAuthorize(); assertFalse(authState.isAuthorizeInProgress()); assertNull(authState.getAuthHandler()); }
@Test public void testEndAuthorize_noAuthorizeInProgress() { final AuthState authState = new AuthState(); authState.endAuthorize(); }