private void checkSeekingConsistency(List<DataBlockEncoder.EncodedSeeker> encodedSeekers,
    boolean seekBefore, ExtendedCell keyValue) {
    ExtendedCell expectedKeyValue = null;
    ByteBuffer expectedKey = null;
    ByteBuffer expectedValue = null;
    for (DataBlockEncoder.EncodedSeeker seeker : encodedSeekers) {
      seeker.seekToKeyInBlock(keyValue, seekBefore);
      seeker.rewind();

      ExtendedCell actualKeyValue = seeker.getCell();
      ByteBuffer actualKey = null;
      actualKey = ByteBuffer.wrap(((KeyValue) seeker.getKey()).getKey());
      ByteBuffer actualValue = seeker.getValueShallowCopy();

      if (expectedKeyValue != null) {
        assertTrue(PrivateCellUtil.equals(expectedKeyValue, actualKeyValue));
      } else {
        expectedKeyValue = actualKeyValue;
      }

      if (expectedKey != null) {
        assertEquals(expectedKey, actualKey);
      } else {
        expectedKey = actualKey;
      }

      if (expectedValue != null) {
        assertEquals(expectedValue, actualValue);
      } else {
        expectedValue = actualValue;
      }
    }
  }
Test whether the decompression of first key is implemented correctly.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java