protected void testBlockContainingKeyInternals(TagUsage tagUsage) throws IOException {
    Path p = makeNewFile(tagUsage);
    FileSystem fs = TEST_UTIL.getTestFileSystem();
    Configuration conf = TEST_UTIL.getConfiguration();
    HFile.Reader reader = HFile.createReader(fs, p, new CacheConfig(conf), true, conf);
    HFileBlockIndex.BlockIndexReader blockIndexReader = reader.getDataBlockIndexReader();
    System.out.println(blockIndexReader.toString());
    // falls before the start of the file.
    assertEquals(-1, blockIndexReader.rootBlockContainingKey(toKV("a", tagUsage)));
    assertEquals(0, blockIndexReader.rootBlockContainingKey(toKV("c", tagUsage)));
    assertEquals(0, blockIndexReader.rootBlockContainingKey(toKV("d", tagUsage)));
    assertEquals(0, blockIndexReader.rootBlockContainingKey(toKV("e", tagUsage)));
    assertEquals(0, blockIndexReader.rootBlockContainingKey(toKV("g", tagUsage)));
    assertEquals(1, blockIndexReader.rootBlockContainingKey(toKV("h", tagUsage)));
    assertEquals(1, blockIndexReader.rootBlockContainingKey(toKV("i", tagUsage)));
    assertEquals(1, blockIndexReader.rootBlockContainingKey(toKV("j", tagUsage)));
    assertEquals(1, blockIndexReader.rootBlockContainingKey(toKV("k", tagUsage)));
    assertEquals(1, blockIndexReader.rootBlockContainingKey(toKV("l", tagUsage)));
    reader.close();
    deleteTestDir(fs);
  }
Test {@link HFileScanner#seekTo(Cell)} and its variants.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestSeekTo.java