private Result[] prependCombined(Result[] results, int length) throws IOException {
    if (length == 0) {
      return new Result[] { combine() };
    }
    // the last part of a partial result may not be marked as partial so here we need to check if
    // there is a row change.
    int start;
    if (Bytes.equals(partialResults.get(0).getRow(), results[0].getRow())) {
      partialResults.add(results[0]);
      start = 1;
      length--;
    } else {
      start = 0;
    }
    Result[] prependResults = new Result[length + 1];
    prependResults[0] = combine();
    System.arraycopy(results, start, prependResults, 1, length);
    return prependResults;
  }
A scan result cache that only returns complete result.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/CompleteScanResultCache.java