@Test
  public void testAddWithIssuer() {
    String accountName = "johndoe@dasher.com";
    // Add the account as a "Google Account" and verify the result
    accountDb.add(accountName, SECRET, OtpType.TOTP, null, null, GOOGLE_ISSUER);
    assertThat(accountDb.getAccounts()).containsExactly(index(accountName, GOOGLE_ISSUER));
    validateAccountRecord(index(accountName, GOOGLE_ISSUER), SECRET, OtpType.TOTP, 0, true);

    // Re-add the same account, overwriting the current values
    accountDb.add(accountName, SECRET2, OtpType.HOTP, 4, null, GOOGLE_ISSUER);
    assertThat(accountDb.getAccounts()).containsExactly(index(accountName, GOOGLE_ISSUER));
    validateAccountRecord(index(accountName, GOOGLE_ISSUER), SECRET2, OtpType.HOTP, 4, true);

    // Add an account with the same name but a different issuer, which should not conflict
    accountDb.add(accountName, SECRET3, OtpType.TOTP, 8, null, ISSUER2);
    assertThat(accountDb.getAccounts())
        .containsExactly(index(accountName, GOOGLE_ISSUER), index(accountName, ISSUER2));
    validateAccountRecord(index(accountName, ISSUER2), SECRET3, OtpType.TOTP, 8, false);
    // Check that the GOOGLE_ISSUER account was unaffected
    validateAccountRecord(index(accountName, GOOGLE_ISSUER), SECRET2, OtpType.HOTP, 4, true);
  }
A list of {@link TestAccount}s that all have issuers.
javatests/com/google/android/apps/authenticator/otp/AccountDbTest.java