private byte[][] generateRandomStartKeys(int numKeys) {
    Random random = ThreadLocalRandom.current();
    byte[][] ret = new byte[numKeys][];
    // first region start key is always empty
    ret[0] = HConstants.EMPTY_BYTE_ARRAY;
    for (int i = 1; i < numKeys; i++) {
      ret[i] = generateData(random, DEFAULT_VALUE_LENGTH);
    }
    return ret;
  }
Test that {@link HFileOutputFormat2} RecordWriter writes tags such as ttl into hfile.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java