private void checkBackupFileWithVersion(Collection<Account> expectedAccounts, Path backupPath)
      throws JSONException, IOException {
    try (BufferedReader reader = Files.newBufferedReader(backupPath)) {
      Account[] accounts = objectMapper.readValue(reader, Account[].class);
      assertEquals("unexpected array size", expectedAccounts.size(), accounts.length);
      Set<Account> expectedAccountSet = new HashSet<>(expectedAccounts);
      for (int i = 0; i < accounts.length; i++) {
        Account account = accounts[i];
        assertTrue("unexpected account in array: " + account.toString(), expectedAccountSet.contains(account));
      }
    }
  }
Check that the provided backup file matches the data in the corresponding serialized accounts.
@param expectedAccounts the expected {@link Account}s.
@param backupPath the {@link Path} to the backup file.
@throws JSONException
ambry-account/src/test/java/com/github/ambry/account/HelixAccountServiceTest.java