@Test(timeout = 30000)
public void testDecrementSafeBlockCount() {

  bmSafeMode.activate(BLOCK_TOTAL);
  Whitebox.setInternalState(bmSafeMode, "extension", 0);
  mockBlockManagerForBlockSafeDecrement();
  setBlockSafe(BLOCK_THRESHOLD);
  for (long i = BLOCK_THRESHOLD; i > 0; i--) {
    BlockInfo blockInfo = mock(BlockInfo.class);
    bmSafeMode.decrementSafeBlockCount(blockInfo);
    assertEquals(i - 1, getblockSafe());
    assertTrue(bmSafeMode.isInSafeMode());
  }
}