@Test
  public void testNotifyFileCachingCompletedNotAllCached() throws Exception {
    BucketCache bucketCache = null;
    try {
      Path filePath = new Path(HBASE_TESTING_UTILITY.getDataTestDir(),
        "testNotifyFileCachingCompletedNotAllCached");
      // Deliberately passing more blocks than we have created to test that
      // notifyFileCachingCompleted will not consider the file fully cached
      bucketCache = testNotifyFileCachingCompletedForTenBlocks(filePath, 12, false);
      assertFalse(bucketCache.fullyCachedFiles.containsKey(filePath.getName()));
    } finally {
      if (bucketCache != null) {
        bucketCache.shutdown();
      }
      HBASE_TESTING_UTILITY.cleanupTestDir();
    }
  }
This test is for HBASE-26295, {@link BucketEntry} which is restored from a persistence file
could not be freed even if corresponding {@link HFileBlock} is evicted from
{@link BucketCache}.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestBucketCache.java