@Test
  public void testCleanUpStagingDirectoryValid() throws IOException {
    String targetPath = tempDir.getAbsolutePath();
    String stagingDirectoryName = "staging";
    String storeId = "store1";

    // Create a staging directory
    File stagingDir = new File(targetPath, stagingDirectoryName);
    assertTrue("Failed to create staging directory", stagingDir.mkdir());

    // Create a file in the staging directory
    File fileInStaging = new File(stagingDir, "10_0_2000_index");
    try (FileOutputStream fos = new FileOutputStream(fileInStaging)) {
      fos.write("test data".getBytes());
    }

    File fileInTempDir = new File(tempDir, "10_0_18_index");

    // Create a log and index file in the temp directory that should not be deleted
    File indexFileNotToBeDeleted = new File(tempDir, "0_0_18_index");
    File logFileNotToBeDeleted = new File(tempDir, "0_0_log");

    try (FileOutputStream fos = new FileOutputStream(logFileNotToBeDeleted)) {
      fos.write("log file data".getBytes());
    }



    fileInTempDir.createNewFile();
    indexFileNotToBeDeleted.createNewFile();
    // Call cleanUpStagingDirectory
    fileStore.cleanUpStagingDirectory(targetPath, stagingDirectoryName, storeId);

    // Verify that the staging directory is deleted
    assertFalse("Staging directory should be deleted", stagingDir.exists());
    assertFalse("File should be moved to temp directory", fileInTempDir.exists());
    assertTrue("Log file should not be deleted", logFileNotToBeDeleted.exists());
    assertTrue("Index file should not be deleted", indexFileNotToBeDeleted.exists());
  }
Returns the number of segments remaining in the reserve pool for the given store ID and segment size.
@param storeId the ID of the store.
@param segmentSize the size of the segment.
@return the number of segments remaining in the reserve pool.
ambry-store/src/test/java/com/github/ambry/store/FileStoreTest.java