@Test
  public void testGetTitle() {
    activityTestRule.launchActivity(null);
    View contentNoAccounts = activityTestRule.getActivity().findViewById(R.id.content_no_accounts);
    assertThat(contentNoAccounts).isNotNull();
    View contentAccountsPresent =
        activityTestRule.getActivity().findViewById(R.id.content_accounts_present);
    assertThat(contentAccountsPresent).isNotNull();
    assertThat(activityTestRule.getActivity().getTitle().toString())
        .isEqualTo(activityTestRule.getActivity().getString(R.string.app_name));
  }
Unit tests for {@link AuthenticatorActivity} (part/shard 1).
javatests/com/google/android/apps/authenticator/AuthenticatorActivityTest.java