@Test
public void testByteBufferObjectInspector() {
byte[] bytes = {0, 9, 4, 18, 64, 6, 1};
BytesWritable bw = new BytesWritable(bytes);
ByteBuffer buf = ByteBuffer.wrap(bytes);
ByteBufferObjectInspector bboi = new ByteBufferObjectInspector();
assertArrayEquals(bytes, bboi.getPrimitiveJavaObject(buf));
assertEquals(bw, bboi.getPrimitiveWritableObject(buf));
assertEquals(buf, bboi.create(bytes));
assertEquals(buf, bboi.create(bw));
ByteBuffer newBuf = bboi.copyObject(buf);
assertTrue(buf != newBuf);
assertEquals(buf, newBuf);
}