@Test
  public void testWritableBinaryObjectInspector() throws Throwable {
    BytesWritable bW = getInputBytesWritable();

    //test WritableBinaryObjectInspector
    WritableBinaryObjectInspector writableBinInsp =
        PrimitiveObjectInspectorFactory.writableBinaryObjectInspector;

    //convert BytesWritable to byte[]
    byte[] outBARef = writableBinInsp.getPrimitiveJavaObject(bW);

    assertTrue("compare input and output BAs",
        Arrays.equals(inpBArray, outBARef));
  }
Test to see if byte[] with correct contents is generated by
WritableBinaryObjectInspector from input BytesWritable
@throws Throwable
serde/src/test/org/apache/hadoop/hive/serde2/lazybinary/TestLazyBinarySerDe.java