PreferencesActivity extends WebViewActivity { @Override public void onBackPressed() { setResult(RESULT_OK); finish(); }  @Override void onBackPressed(); static final String EXTRA_USER_TOKEN; }
@Test public void backButtonPress_ShouldCallFinishWithResultOK() { preferencesActivity.onBackPressed(); verify(preferencesActivity).setResult(RegistrationActivity.RESULT_OK); verify(preferencesActivity).finish(); }