### Question:
BucketCache implements BlockCache, HeapSize { void stopWriterThreads() throws InterruptedException { for (WriterThread writerThread : writerThreads) { writerThread.disableWriter(); writerThread.interrupt(); writerThread.join(); } } BucketCache(String ioEngineName, long capacity, int writerThreadNum,
      int writerQLen, String persistencePath);  BucketCache(String ioEngineName, long capacity, int writerThreadNum,
      int writerQLen, String persistencePath, int ioErrorsTolerationDuration); @Override void cacheBlock(BlockCacheKey cacheKey, Cacheable buf); @Override void cacheBlock(BlockCacheKey cacheKey, Cacheable cachedItem, boolean inMemory); void cacheBlockWithWait(BlockCacheKey cacheKey, Cacheable cachedItem,
      boolean inMemory, boolean wait); @Override Cacheable getBlock(BlockCacheKey key, boolean caching, boolean repeat); @Override boolean evictBlock(BlockCacheKey cacheKey); void logStats(); @Override void shutdown(); @Override CacheStats getStats(); long heapSize(); @Override long size(); @Override long getFreeSize(); @Override long getBlockCount(); @Override long getCurrentSize(); @Override long getEvictedCount(); @Override int evictBlocksByHfileName(String hfileName); @Override List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries(
      Configuration conf); static final int DEFAULT_ERROR_TOLERATION_DURATION; }### Answer:
@Test public void testHeapSizeChanges() throws Exception { cache.stopWriterThreads(); CacheTestUtils.testHeapSizeChanges(cache, BLOCK_SIZE); }