public static List<KeyValue> rewindThenToList(final ByteBuffer bb,
    final boolean includesMemstoreTS, final boolean useTags) {
    bb.rewind();
    List<KeyValue> kvs = Lists.newArrayList();
    KeyValue kv = null;
    while (true) {
      kv = KeyValueUtil.nextShallowCopy(bb, includesMemstoreTS, useTags);
      if (kv == null) {
        break;
      }
      kvs.add(kv);
    }
    return kvs;
  }
Checks whether KeyValues from kvCollection2 are contained in kvCollection1. The comparison is
made without distinguishing MVCC version of the KeyValues
@return true if KeyValues from kvCollection2 are contained in kvCollection1
hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueTestUtil.java