@Test
  public void testGetPrefixedNameFor() {
    String accountName = "accountname";
    String issuer = "Some issuer";
    String prefixedName = issuer + ":" + accountName;
    String whitespacePrefixedName = issuer + ":  " + accountName;
    assertThat(AccountDb.getPrefixedNameFor(accountName, issuer)).isEqualTo(prefixedName);
    // If the name is already prefixed, it should be returned unaltered
    assertThat(AccountDb.getPrefixedNameFor(prefixedName, issuer)).isEqualTo(prefixedName);
    assertThat(AccountDb.getPrefixedNameFor(whitespacePrefixedName, issuer))
        .isEqualTo(whitespacePrefixedName);

    for (AccountIndex index : TEST_ACCOUNTS_WITH_ISSUER) {
      assertThat(AccountDb.getPrefixedNameFor(index.getName(), index.getIssuer()))
          .startsWith(index.getIssuer() + ":");
    }
  }
A list of {@link TestAccount}s that all have issuers.
javatests/com/google/android/apps/authenticator/otp/AccountDbTest.java