@Override
    public boolean next(List<? super ExtendedCell> result, ScannerContext scannerContext)
      throws IOException {
      if (kvs.isEmpty()) {
        return false;
      }
      result.add(kvs.remove(0));
      return !kvs.isEmpty();
    }
This method actually does all the work.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java