private Result getByteBufferBackedTagResult(Tag tag) {
    List<Tag> tags = null;
    if (tag != null) {
      tags = Arrays.asList(tag);
    }
    KeyValue kvCell = new KeyValue(row, family, qual, 0L, KeyValue.Type.Put, value, tags);
    ByteBuffer buf = ByteBuffer.allocateDirect(kvCell.getBuffer().length);
    ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), 0, kvCell.getBuffer().length);
    ByteBufferKeyValue bbKV = new ByteBufferKeyValue(buf, 0, buf.capacity(), 0L);
    return Result.create(new Cell[] { bbKV });
  }
Verify that Result.compareResults(...) behaves correctly.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestResult.java