LoginActivity extends RapidFtrActivity { @UiThread protected void goToHomeScreenIfLoggedIn() { if (getContext().isLoggedIn()){ finish(); startActivity(new Intent(this, RegisterChildActivity.class)); } else { Intent broadcastLogout = new Intent(LOGOUT_INTENT_FILTER); sendBroadcast(broadcastLogout); } }  @AfterViews void afterCreate(); @Click(R.id.change_url) void onChangeUrlClick(); @Click(R.id.login_button) void onLoginClick(); @Click(R.id.new_user_signup_link) void onSignupClick();  }
@Test public void testGoToHomeScreenIfLoggedIn() { doCallRealMethod().when(loginActivity).afterCreate(); loginActivity.afterCreate(); verify(loginActivity).goToHomeScreenIfLoggedIn(); }