private BucketCache testNotifyFileCachingCompletedForTenBlocks(Path filePath,
    int totalBlocksToCheck, boolean encoded) throws Exception {
    final Path dataTestDir = createAndGetTestDir();
    String ioEngineName = "file:" + dataTestDir + "/bucketNoRecycler.cache";
    BucketCache bucketCache = new BucketCache(ioEngineName, capacitySize, constructedBlockSize,
      constructedBlockSizes, 1, 1, null);
    assertTrue(bucketCache.waitForCacheInitialization(10000));
    long usedByteSize = bucketCache.getAllocator().getUsedSize();
    assertEquals(0, usedByteSize);
    HFileBlockPair[] hfileBlockPairs =
      CacheTestUtils.generateBlocksForPath(constructedBlockSize, 10, filePath, encoded);
    // Add blocks
    for (HFileBlockPair hfileBlockPair : hfileBlockPairs) {
      bucketCache.cacheBlock(hfileBlockPair.getBlockName(), hfileBlockPair.getBlock(), false, true);
    }
    bucketCache.notifyFileCachingCompleted(filePath, totalBlocksToCheck, totalBlocksToCheck,
      totalBlocksToCheck * constructedBlockSize);
    return bucketCache;
  }
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