public void doTestFindMatchingGoogleAccount(boolean usePrefix) {
    addAllTestRecords();
    String prefix = "";
    if (usePrefix) {
      prefix = "Google:";
    }
    String gmailUserAccountName = "a.new.user@gmail.com";
    String dasherUserAccountName = "carol@new-dasher.com";

    // Test with a non-matching account
    assertThat(accountDb.findMatchingGoogleAccount("no.such.accountname@gmail.com")).isNull();

    // Test a corp account name
    assertThat(accountDb.findMatchingGoogleAccount("sergey@google.com").getName())
        .isEqualTo(AccountDb.GOOGLE_CORP_ACCOUNT_NAME);

    // Try with a new style account for a gmail user
    TestAccount gmailUserWithIssuer = new TestAccount(
        prefix + gmailUserAccountName, SECRET, OtpType.TOTP, null, null, GOOGLE_ISSUER);
    assertThat(findMatchingGoogleWorksFor(gmailUserWithIssuer)).isTrue();
    assertThat(findMatchingGoogleAccountWorksAfterRenamingFor(gmailUserWithIssuer)).isTrue();

    // Try with a new style account for a dasher user
    TestAccount dasherUserWithIssuer = new TestAccount(
        prefix + dasherUserAccountName, SECRET, OtpType.TOTP, null, null, GOOGLE_ISSUER);
    assertThat(findMatchingGoogleWorksFor(dasherUserWithIssuer)).isTrue();
    assertThat(findMatchingGoogleAccountWorksAfterRenamingFor(dasherUserWithIssuer)).isTrue();

    // Try with an old style account for a gmail user
    TestAccount gmailUserWithNullIssuer = new TestAccount(
        prefix + gmailUserAccountName, SECRET, OtpType.TOTP, null, null, null);
    assertThat(findMatchingGoogleWorksFor(gmailUserWithNullIssuer)).isTrue();
    assertThat(findMatchingGoogleAccountWorksAfterRenamingFor(gmailUserWithNullIssuer)).isFalse();

    // Try with an old style account for a dasher user
    TestAccount dasherUserWithNullIssuer = new TestAccount(
        prefix + dasherUserAccountName, SECRET, OtpType.TOTP, null, null, null);
    assertThat(findMatchingGoogleWorksFor(dasherUserWithNullIssuer)).isTrue();
    assertThat(findMatchingGoogleAccountWorksAfterRenamingFor(dasherUserWithNullIssuer)).isFalse();
  }
Note: caller should carefully determine the expected value of {@code isGoogleAccount}, which
is affected by multiple factors.

@param isGoogleAccount is a {@code boolean}, not a {@link Boolean}
javatests/com/google/android/apps/authenticator/otp/AccountDbTest.java