@Test
  public void testInitializationAndClose() throws InterruptedException {
    int bucketCount = bucketingEnabled ? 1 : 0;
    final CountDownLatch scanStartedLatch = new CountDownLatch(1);
    MockThrottler mockThrottler = new MockThrottler(scanStartedLatch, new CountDownLatch(0));
    throttlers.put(BlobStoreStats.IO_SCHEDULER_JOB_TYPE, mockThrottler);
    BlobStoreStats blobStoreStats = setupBlobStoreStats(bucketCount, 0);
    if (bucketingEnabled) {
      // IndexScanner should be started if bucketing is enabled
      assertTrue("IndexScanner took too long to start", scanStartedLatch.await(5, TimeUnit.SECONDS));
    } else {
      // IndexScanner should not be started if bucketing is disabled
      assertEquals("IndexScanner should not be started", 0, mockThrottler.throttleCount.get());
    }
    blobStoreStats.close();
  }
Test {@link BlobStoreStats} can be initialized (with bucketing enabled/disabled) and closed properly.
@throws InterruptedException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreStatsTest.java