@Test
  public void testNullByteArrayKeyValueFailure() {
    // can't add to testCheckKeyValueBytesFailureCase because it
    // goes through the InputStream KeyValue API which can't produce a null buffer
    try {
      new KeyValue(null, 0, 0);
    } catch (IllegalArgumentException iae) {
      assertEquals("Invalid to have null byte array in KeyValue.", iae.getMessage());
      return;
    }
    fail("Should have thrown an IllegalArgumentException when "
      + "creating a KeyValue with a null buffer");
  }
Tests that getTimestamp() does always return the proper timestamp, even after updating it. See
HBASE-6265.
hbase-common/src/test/java/org/apache/hadoop/hbase/TestKeyValue.java