LazyByte b = new LazyByte(
LazyPrimitiveObjectInspectorFactory.LAZY_BYTE_OBJECT_INSPECTOR);
initLazyObject(b, new byte[] {'0'}, 0, 0);
assertNull(b.getWritableObject());
initLazyObject(b, new byte[] {'0'}, 0, 1);
assertEquals(new ByteWritable((byte) 0), b.getWritableObject());
initLazyObject(b, new byte[] {'+', '0'}, 0, 2);
assertEquals(new ByteWritable((byte) 0), b.getWritableObject());
initLazyObject(b, new byte[] {'-', '0'}, 0, 2);
assertEquals(new ByteWritable((byte) 0), b.getWritableObject());
initLazyObject(b, new byte[] {'a', '1', 'b'}, 1, 1);
assertEquals(new ByteWritable((byte) 1), b.getWritableObject());
initLazyObject(b, new byte[] {'a', '-', '1'}, 1, 2);
assertEquals(new ByteWritable((byte) -1), b.getWritableObject());
initLazyObject(b, new byte[] {'a', '+', '1'}, 1, 2);
assertEquals(new ByteWritable((byte) 1), b.getWritableObject());
initLazyObject(b, new byte[] {'-', '1', '2', '8'}, 0, 4);
assertEquals(new ByteWritable((byte) -128), b.getWritableObject());
initLazyObject(b, new byte[] {'+', '1', '2', '7'}, 0, 4);
assertEquals(new ByteWritable((byte) 127), b.getWritableObject());
initLazyObject(b, new byte[] {'a', '1', 'b'}, 1, 2);
assertNull(b.getWritableObject());
initLazyObject(b, new byte[] {'+', '1', '2', '8'}, 0, 4);
assertNull(b.getWritableObject());