LazyShort b = new LazyShort(
LazyPrimitiveObjectInspectorFactory.LAZY_SHORT_OBJECT_INSPECTOR);
initLazyObject(b, new byte[] {'0'}, 0, 0);
assertNull(b.getWritableObject());
initLazyObject(b, new byte[] {'0'}, 0, 1);
assertEquals(new ShortWritable((short) 0), b.getWritableObject());
initLazyObject(b, new byte[] {'+', '0'}, 0, 2);
assertEquals(new ShortWritable((short) 0), b.getWritableObject());
initLazyObject(b, new byte[] {'-', '0'}, 0, 2);
assertEquals(new ShortWritable((short) 0), b.getWritableObject());
initLazyObject(b, new byte[] {'a', '1', 'b'}, 1, 1);
assertEquals(new ShortWritable((short) 1), b.getWritableObject());
initLazyObject(b, new byte[] {'a', '-', '1'}, 1, 2);
assertEquals(new ShortWritable((short) -1), b.getWritableObject());
initLazyObject(b, new byte[] {'a', '+', '1'}, 1, 2);
assertEquals(new ShortWritable((short) 1), b.getWritableObject());
initLazyObject(b, new byte[] {'-', '1', '2', '8'}, 0, 4);
assertEquals(new ShortWritable((short) -128), b.getWritableObject());
initLazyObject(b, new byte[] {'+', '1', '2', '7'}, 0, 4);
assertEquals(new ShortWritable((short) 127), b.getWritableObject());
initLazyObject(b, new byte[] {'-', '3', '2', '7', '6', '8'}, 0, 6);
assertEquals(new ShortWritable((short) -32768), b.getWritableObject());
initLazyObject(b, new byte[] {'+', '3', '2', '7', '6', '7'}, 0, 6);
assertEquals(new ShortWritable((short) 32767), b.getWritableObject());
initLazyObject(b, new byte[] {'a', '1', 'b'}, 1, 2);
assertNull(b.getWritableObject());
initLazyObject(b, new byte[] {'-', '3', '2', '7', '6', '9'}, 0, 6);
assertNull(b.getWritableObject());