protected void checkScanOrder(Cell prevKV, Cell kv, CellComparator comparator)
    throws IOException {
    // Check that the heap gives us KVs in an increasing order.
    assert prevKV == null || comparator == null || comparator.compare(prevKV, kv) <= 0
      : "Key " + prevKV + " followed by a smaller key " + kv + " in cf " + store;
  }
Check whether scan as expected order
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java