@Test
  public void testCacheSizeCapacity() throws IOException {
    // Test cache capacity (capacity / blockSize) < Integer.MAX_VALUE
    validateGetPartitionSize(cache, DEFAULT_SINGLE_FACTOR, DEFAULT_MIN_FACTOR);
    Configuration conf = HBaseConfiguration.create();
    conf.setFloat(BucketCache.MIN_FACTOR_CONFIG_NAME, 0.5f);
    conf.setFloat(SINGLE_FACTOR_CONFIG_NAME, 0.1f);
    conf.setFloat(MULTI_FACTOR_CONFIG_NAME, 0.7f);
    conf.setFloat(MEMORY_FACTOR_CONFIG_NAME, 0.2f);
    try {
      new BucketCache(ioEngineName, Long.MAX_VALUE, 1, constructedBlockSizes, writeThreads,
        writerQLen, null, 100, conf);
      Assert.fail("Should have thrown IllegalArgumentException because of large cache capacity!");
    } catch (IllegalArgumentException e) {
      Assert.assertEquals("Cache capacity is too large, only support 32TB now", e.getMessage());
    }
  }
<pre>
The asserts here before HBASE-21957 are:
assertEquals(1L, cache.getBlockCount());
assertTrue(cache.getCurrentSize() > 0L);
assertTrue("We should have a block!", cache.iterator().hasNext());

The asserts here after HBASE-21957 are:
assertEquals(0, cache.getBlockCount());
assertEquals(cache.getCurrentSize(), 0L);

I think the asserts before HBASE-21957 is more reasonable,because
{@link BucketCache#evictBlock} should only evict the {@link BucketEntry}
it had seen, and newly added Block after the {@link BucketEntry}
it had seen should not be evicted.
</pre>
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestBucketCache.java