@Test
  public void testNoAccountUi() {
    activityTestRule.launchActivity(null);
    onView(withId(R.id.user_list)).check(matches(not(isDisplayed())));
    onView(withId(R.id.add_account_fab)).check(matches(not(isDisplayed())));

    onView(withId(R.id.add_account_button)).check(matches(isDisplayed()));
    onView(withId(R.id.content_no_accounts)).check(matches(isDisplayed()));
  }
Unit tests for {@link AuthenticatorActivity} (part/shard 1).
javatests/com/google/android/apps/authenticator/AuthenticatorActivityTest.java