@Test
  public void testPutCreationWithByteBuffer() {
    Put p = new Put(ROW);
    List<Cell> c = p.get(FAMILY, QUALIFIER);
    Assert.assertEquals(0, c.size());
    Assert.assertEquals(HConstants.LATEST_TIMESTAMP, p.getTimestamp());

    p.addColumn(FAMILY, ByteBuffer.wrap(QUALIFIER), 1984L, ByteBuffer.wrap(VALUE));
    c = p.get(FAMILY, QUALIFIER);
    Assert.assertEquals(1, c.size());
    Assert.assertEquals(1984L, c.get(0).getTimestamp());
    Assert.assertArrayEquals(VALUE, CellUtil.cloneValue(c.get(0)));
    Assert.assertEquals(HConstants.LATEST_TIMESTAMP, p.getTimestamp());
    Assert.assertEquals(0,
      CellComparatorImpl.COMPARATOR.compare(c.get(0), new KeyValue((ExtendedCell) c.get(0))));

    p = new Put(ROW);
    p.addColumn(FAMILY, ByteBuffer.wrap(QUALIFIER), 2013L, null);
    c = p.get(FAMILY, QUALIFIER);
    Assert.assertEquals(1, c.size());
    Assert.assertEquals(2013L, c.get(0).getTimestamp());
    Assert.assertArrayEquals(new byte[] {}, CellUtil.cloneValue(c.get(0)));
    Assert.assertEquals(HConstants.LATEST_TIMESTAMP, p.getTimestamp());
    Assert.assertEquals(0,
      CellComparatorImpl.COMPARATOR.compare(c.get(0), new KeyValue((ExtendedCell) c.get(0))));

    p = new Put(ByteBuffer.wrap(ROW));
    p.addColumn(FAMILY, ByteBuffer.wrap(QUALIFIER), 2001L, null);
    c = p.get(FAMILY, QUALIFIER);
    Assert.assertEquals(1, c.size());
    Assert.assertEquals(2001L, c.get(0).getTimestamp());
    Assert.assertArrayEquals(new byte[] {}, CellUtil.cloneValue(c.get(0)));
    Assert.assertArrayEquals(ROW, CellUtil.cloneRow(c.get(0)));
    Assert.assertEquals(HConstants.LATEST_TIMESTAMP, p.getTimestamp());
    Assert.assertEquals(0,
      CellComparatorImpl.COMPARATOR.compare(c.get(0), new KeyValue((ExtendedCell) c.get(0))));

    p = new Put(ByteBuffer.wrap(ROW), 1970L);
    p.addColumn(FAMILY, ByteBuffer.wrap(QUALIFIER), 2001L, null);
    c = p.get(FAMILY, QUALIFIER);
    Assert.assertEquals(1, c.size());
    Assert.assertEquals(2001L, c.get(0).getTimestamp());
    Assert.assertArrayEquals(new byte[] {}, CellUtil.cloneValue(c.get(0)));
    Assert.assertArrayEquals(ROW, CellUtil.cloneRow(c.get(0)));
    Assert.assertEquals(1970L, p.getTimestamp());
    Assert.assertEquals(0,
      CellComparatorImpl.COMPARATOR.compare(c.get(0), new KeyValue((ExtendedCell) c.get(0))));
  }
Test the client Scan Operations' JSON encoding to ensure that produced JSON is parseable and
that the details are present and not corrupted.
@throws IOException if the JSON conversion fails
hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java