@Override
  public Result next() throws IOException {
    if (!moreRows) {
      return null;
    }
    for (;;) {
      moreRows = scanner.next(cells);
      if (cells.isEmpty()) {
        if (!moreRows) {
          return null;
        } else {
          continue;
        }
      }
      Result result = Result.create(cells);
      cells.clear();
      return result;
    }
  }
Wrap a {@link RegionScanner} as a {@link ResultScanner}.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/RegionScannerAsResultScanner.java