public static void getBlockAndAssertEquals(BlockCache cache, BlockCacheKey key,
    Cacheable blockToCache, ByteBuffer destBuffer, ByteBuffer expectedBuffer) {
    destBuffer.clear();
    cache.cacheBlock(key, blockToCache);
    Cacheable actualBlock = cache.getBlock(key, false, false, false);
    try {
      actualBlock.serialize(destBuffer, true);
      assertEquals(expectedBuffer, destBuffer);
    } finally {
      // Release the reference count increased by getBlock.
      if (actualBlock != null) {
        actualBlock.release();
      }
    }
  }
Just checks if heapsize grows when something is cached, and gets smaller when the same object
is evicted
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java