@Test
  public void testGetLatestState_BackupFilesAllWithVersion() throws IOException {
    final int startVersion = 1;
    final int endVersion = startVersion + maxBackupFile / 2;
    final long baseModifiedTime = System.currentTimeMillis() / 1000 - 100;
    final long interval = 2;
    String[] filenames =
        createBackupFilesWithVersion(accountBackupDir, startVersion, endVersion, baseModifiedTime, interval, false);
    saveAccountsToFile(Collections.singleton(refAccount), accountBackupDir.resolve(filenames[filenames.length - 1]));

    BackupFileManager backup =
        new BackupFileManager(accountServiceMetrics, config.backupDir, config.maxBackupFileCount);
    Collection<Account> obtained = backup.getLatestAccounts(0);
    assertEquals(Collections.singletonList(refAccount), obtained);
    assertFalse("There are backup files", backup.isEmpty());

    obtained = backup.getLatestAccounts(System.currentTimeMillis() / 1000);
    assertNull("No backup file should have a modified time later than now", obtained);
    assertEquals(backup.size(), endVersion - startVersion + 1);
  }
Test getLatestAccounts function when all the backup files are files with version number.
@throws IOException if I/O error occurs
ambry-account/src/test/java/com/github/ambry/account/BackupFileManagerTest.java