protected ExtendedCell getNextRow(final ExtendedCell key, final NavigableSet<ExtendedCell> set) {
    ExtendedCell result = null;
    SortedSet<ExtendedCell> tail = key == null ? set : set.tailSet(key);
    // Iterate until we fall into the next row; i.e. move off current row
    for (ExtendedCell cell : tail) {
      if (comparator.compareRows(cell, key) <= 0) {
        continue;
      }
      // Note: Not suppressing deletes or expired cells. Needs to be handled
      // by higher up functions.
      result = cell;
      break;
    }
    return result;
  }
@param key Find row that follows this one. If null, return first.
@param set Set to look in for a row beyond <code>row</code>.
@return Next row or null if none found. If one found, will be a new KeyValue -- can be
        destroyed by subsequent calls to this method.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMemStore.java