public void doTestRename(String issuer) {
    String accountName = "johndoe@gmail.com";
    AccountIndex index = index(accountName, issuer);
    String newAccountName = "johndoe@yahoo.com";
    AccountIndex newIndex = index(newAccountName, issuer);

    boolean expectGoogleAccount = (issuer == null) || issuer.equals(GOOGLE_ISSUER);
    accountDb.add(accountName, SECRET, OtpType.TOTP, 5, true, issuer);
    assertThat(accountDb.getAccounts()).containsExactly(index).inOrder();
    validateAccountRecord(index, SECRET, OtpType.TOTP, 5, expectGoogleAccount);

    // Rename -- check that everything (except the name) is preserved
    assertThat(accountDb.rename(index, newAccountName)).isTrue();
    assertThat(accountDb.getAccounts()).containsExactly(newIndex).inOrder();
    // The "Google Account" flag should be preserved since it was explicitly set in the add() above
    validateAccountRecord(newIndex, SECRET, OtpType.TOTP, 5, expectGoogleAccount);

    // Rename back to the original
    assertThat(accountDb.rename(newIndex, accountName)).isTrue();
    assertThat(accountDb.getAccounts()).containsExactly(index).inOrder();
    validateAccountRecord(index, SECRET, OtpType.TOTP, 5, expectGoogleAccount);
  }
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