private static CheckAndMutateResult getCheckAndMutateResult(RegionActionResult actionResult,
    CellScanner cells) throws IOException {
    Result result = null;
    QueryMetrics metrics = null;
    if (actionResult.getResultOrExceptionCount() > 0) {
      // Get the result of the Increment/Append operations from the first element of the
      // ResultOrException list
      ResultOrException roe = actionResult.getResultOrException(0);
      if (roe.hasResult()) {
        Result r = ProtobufUtil.toResult(roe.getResult(), cells);
        if (!r.isEmpty()) {
          result = r;
        }
      }

      if (roe.hasMetrics()) {
        metrics = ProtobufUtil.toQueryMetrics(roe.getMetrics());
      }
    }
    return new CheckAndMutateResult(actionResult.getProcessed(), result).setMetrics(metrics);
  }
Get the results from a protocol buffer MultiResponse
@param request  the original protocol buffer MultiRequest
@param indexMap Used to support RowMutations/CheckAndMutate in batch
@param response the protocol buffer MultiResponse to convert
@param cells    Cells to go with the passed in <code>proto</code>. Can be null.
@return the results that were in the MultiResponse (a Result or an Exception).
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ResponseConverter.java