### Question:
BlockManagerImpl implements BlockManager { public void deleteBlock(Container container, BlockID blockID) throws IOException { Preconditions.checkNotNull(blockID, "block ID cannot be null."); Preconditions.checkState(blockID.getContainerID() >= 0, "Container ID cannot be negative."); Preconditions.checkState(blockID.getLocalID() >= 0, "Local ID cannot be negative."); KeyValueContainerData cData = (KeyValueContainerData) container .getContainerData(); try(ReferenceCountedDB db = BlockUtils.getDB(cData, config)) { Preconditions.checkNotNull(db, DB_NULL_ERR_MSG); getBlockByID(db, blockID); BatchOperation batch = db.getStore().getBatchHandler() .initBatchOperation(); String localID = Long.toString(blockID.getLocalID()); db.getStore().getBlockDataTable().deleteWithBatch(batch, localID); long blockCount = container.getContainerData().getKeyCount() - 1; db.getStore().getMetadataTable() .putWithBatch(batch, OzoneConsts.BLOCK_COUNT, blockCount); db.getStore().getBatchHandler().commitBatchOperation(batch); container.getContainerData().decrKeyCount(); } } BlockManagerImpl(ConfigurationSource conf); long putBlock(Container container, BlockData data); long putBlock(Container container, BlockData data,
      boolean incrKeyCount); @Override BlockData getBlock(Container container, BlockID blockID); @Override long getCommittedBlockLength(Container container, BlockID blockID); void deleteBlock(Container container, BlockID blockID); @Override List<BlockData> listBlock(Container container, long startLocalID, int
      count); void shutdown();  }### Answer:
@Test public void testDeleteBlock() throws Exception { assertEquals(0, keyValueContainer.getContainerData().getKeyCount()); blockManager.putBlock(keyValueContainer, blockData); assertEquals(1, keyValueContainer.getContainerData().getKeyCount()); blockManager.deleteBlock(keyValueContainer, blockID); assertEquals(0, keyValueContainer.getContainerData().getKeyCount()); try { blockManager.getBlock(keyValueContainer, blockID); fail("testDeleteBlock"); } catch (StorageContainerException ex) { GenericTestUtils.assertExceptionContains( "Unable to find the block", ex); } }