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

    //create JavaBinaryObjectInspector
    JavaBinaryObjectInspector binInspector =
        PrimitiveObjectInspectorFactory.javaByteArrayObjectInspector;

    //convert BytesWritable to byte][
    byte[] outBARef = binInspector.set(null, bW);

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