@Test
  public void testGetStrippedName() {
    String accountName = "accountname";
    String issuer = "Some issuer";
    String prefixedName = issuer + ":" + accountName;
    String whitespacePrefixedName = issuer + ":  " + accountName + "   ";
    AccountIndex withIssuer = index(accountName, issuer);
    AccountIndex withIssuerAndPrefix = index(prefixedName, issuer);
    AccountIndex withIssuerAndWhitespacePrefix = index(whitespacePrefixedName, issuer);

    assertThat(withIssuer.getStrippedName()).isEqualTo(accountName);
    assertThat(withIssuerAndPrefix.getStrippedName()).isEqualTo(accountName);
    assertThat(withIssuerAndWhitespacePrefix.getStrippedName()).isEqualTo(accountName);

    for (AccountIndex index : TEST_ACCOUNTS_WITH_ISSUER) {
      assertThat(index.getStrippedName().startsWith(index.getIssuer() + ":")).isFalse();
    }

    for (AccountIndex index : TEST_ACCOUNTS_WITH_NULL_ISSUER) {
      assertThat(index.getStrippedName()).isEqualTo(index.getName().trim());
    }
  }
A list of {@link TestAccount}s that all have issuers.
javatests/com/google/android/apps/authenticator/otp/AccountDbTest.java