private void updateAndWriteZNRecord(ZNRecord zNRecord, boolean isGoodZNRecord) throws Exception {
    writeZNRecordToHelixPropertyStore(zNRecord, false);
    accountService = mockHelixAccountServiceFactory.getAccountService();
    assertEquals("Number of account is wrong", 0, accountService.getAllAccounts().size());
    updateAccountsAndAssertAccountExistence(Collections.singletonList(refAccount), isGoodZNRecord ? 1 : 0,
        isGoodZNRecord);
    writeZNRecordToHelixPropertyStore(zNRecord, true);
    if (isGoodZNRecord) {
      assertAccountInAccountService(refAccount, accountService);
    } else {
      assertEquals("Number of accounts is wrong.", 0, accountService.getAllAccounts().size());
    }
  }
Does several operations:
1. Writes a {@link ZNRecord} to {@link HelixPropertyStore} without notifying listeners;
2. Starts up a {@link HelixAccountService} that should fetch the {@link ZNRecord};
3. Updates (creates) one more {@link Account} through the {@link HelixAccountService};
4. Writes the same {@link ZNRecord} to {@link HelixPropertyStore} and publishes a message for {@link Account} update;

If the {@link ZNRecord} is good, it should not affect updating operation.
@param zNRecord A {@link ZNRecord} to write to {@link HelixPropertyStore}.
@param isGoodZNRecord {code true} to indicate the {@link ZNRecord} is good, which should not affect updating
                      operation; {@code false} otherwise.
@throws Exception Any unexpected exception.
ambry-account/src/test/java/com/github/ambry/account/HelixAccountServiceTest.java