@Test
  public void testBasics() {
    LOG.info("LOWKEY: " + KeyValue.LOWESTKEY.toString());
    String name = "testBasics";
    check(Bytes.toBytes(name), Bytes.toBytes(name), Bytes.toBytes(name), 1, Bytes.toBytes(name));
    // Test empty value and empty column -- both should work. (not empty fam)
    check(Bytes.toBytes(name), Bytes.toBytes(name), null, 1, null);
    check(HConstants.EMPTY_BYTE_ARRAY, Bytes.toBytes(name), null, 1, null);
    // empty qual is equivalent to null qual
    assertEquals(new KeyValue(Bytes.toBytes("rk"), Bytes.toBytes("fam"), null, 1, (byte[]) null),
      new KeyValue(Bytes.toBytes("rk"), Bytes.toBytes("fam"), HConstants.EMPTY_BYTE_ARRAY, 1,
        (byte[]) null));
  }
Test a corner case when the family qualifier is a prefix of the column qualifier.
hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java