public static void compareResults(Result res1, Result res2, boolean verbose) throws Exception {
    if (res2 == null) {
      throw new Exception(
        "There wasn't enough rows, we stopped at " + Bytes.toStringBinary(res1.getRow()));
    }
    if (res1.size() != res2.size()) {
      if (verbose) {
        throw new Exception(
          "This row doesn't have the same number of KVs: " + res1 + " compared to " + res2);
      } else {
        throw new Exception(
          "This row doesn't have the same number of KVs: row=" + Bytes.toStringBinary(res1.getRow())
            + ", " + res1.size() + " cells are compared to " + res2.size() + " cells");
      }
    }
    ExtendedCell[] ourKVs = res1.cells;
    ExtendedCell[] replicatedKVs = res2.cells;
    for (int i = 0; i < res1.size(); i++) {
      if (
        !ourKVs[i].equals(replicatedKVs[i]) || !CellUtil.matchingValue(ourKVs[i], replicatedKVs[i])
          || !PrivateCellUtil.matchingTags(ourKVs[i], replicatedKVs[i])
      ) {
        if (verbose) {
          throw new Exception("This result was different: " + res1 + " compared to " + res2);
        } else {
          throw new Exception(
            "This result was different: row=" + Bytes.toStringBinary(res1.getRow()));
        }
      }
    }
  }
Does a deep comparison of two Results, down to the byte arrays.
@param res1    first result to compare
@param res2    second result to compare
@param verbose includes string representation for all cells in the exception if true; otherwise
               include rowkey only
@throws Exception Every difference is throwing an exception
hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java