private static void verifyCompactionThreadCount(StorageManager storageManager, int expectedCount)
      throws InterruptedException {
    // there is no option but to sleep here since we have to wait for the CompactionManager to start the threads up
    // we cannot mock these components since they are internally constructed within the StorageManager and DiskManager.
    int totalWaitTimeMs = 1000;
    int alreadyWaitedMs = 0;
    int singleWaitTimeMs = 10;
    while (storageManager.getCompactionThreadCount() != expectedCount && alreadyWaitedMs < totalWaitTimeMs) {
      Thread.sleep(singleWaitTimeMs);
      alreadyWaitedMs += singleWaitTimeMs;
    }
    assertEquals("Compaction thread count report not as expected", expectedCount,
        storageManager.getCompactionThreadCount());
  }
Verifies that return value {@link StorageManager#getCompactionThreadCount()} of the given {@code storageManager}
is equal to {@code expectedCount}
@param storageManager the {@link StorageManager} instance to use.
@param expectedCount the number of compaction threads expected.
@throws InterruptedException
ambry-store/src/test/java/com/github/ambry/store/StorageManagerTest.java