@Test
  public void testWriteIntoKeyValueFormat() throws IOException {
    // Verify getSerializedSize().
    assertEquals(kv0.getSerializedSize(true), ic0.getSerializedSize(true)); // with tags
    assertEquals(kv0.getSerializedSize(false), ic0.getSerializedSize(false)); // without tags

    // Verify writing into ByteBuffer.
    ByteBuffer bbufIC = ByteBuffer.allocate(ic0.getSerializedSize(true));
    ic0.write(bbufIC, 0);

    ByteBuffer bbufKV = ByteBuffer.allocate(kv0.getSerializedSize(true));
    kv0.write(bbufKV, 0);

    assertTrue(bbufIC.equals(bbufKV));

    // Verify writing into OutputStream.
    testWriteIntoOutputStream(ic0, kv0, true); // with tags
    testWriteIntoOutputStream(ic0, kv0, false); // without tags
  }
Verify KeyValue format related functions: write() and getSerializedSize(). Should have the same
behaviors as {@link KeyValue}.
hbase-common/src/test/java/org/apache/hadoop/hbase/TestIndividualBytesFieldCell.java