try {
LazyDouble b = new LazyDouble(LazyPrimitiveObjectInspectorFactory.lazyDoubleObjectInspector);
initLazyObject(b,new byte[]{'0'}, 0, 0);
assertNull(b.getWritableObject());
initLazyObject(b,new byte[]{'0'}, 0, 1);
assertEquals(new DoubleWritable((double)0), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '0'}, 0, 2);
assertEquals(new DoubleWritable((double)0), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '0'}, 0, 2);
assertEquals(new DoubleWritable((double)-0.0), b.getWritableObject());
initLazyObject(b,new byte[]{'a', '1', 'b'}, 1, 1);
assertEquals(new DoubleWritable((double)1), b.getWritableObject());
initLazyObject(b,new byte[]{'a', '-', '1'}, 1, 2);
assertEquals(new DoubleWritable((double)-1), b.getWritableObject());
initLazyObject(b,new byte[]{'a', '+', '1'}, 1, 2);
assertEquals(new DoubleWritable((double)1), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '1', '2', '8'}, 0, 4);
assertEquals(new DoubleWritable((double)-128), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '1', '2', '7'}, 0, 4);
assertEquals(new DoubleWritable((double)127), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '3', '2', '7', '6', '8'}, 0, 6);
assertEquals(new DoubleWritable((double)-32768), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '3', '2', '7', '6', '7'}, 0, 6);
assertEquals(new DoubleWritable((double)32767), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '2', '1', '4', '7', '4', '8', '3', '6', '4', '8'}, 0, 11);
assertEquals(new DoubleWritable((double)-2147483648), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '2', '1', '4', '7', '4', '8', '3', '6', '4', '7'}, 0, 11);
assertEquals(new DoubleWritable((double)2147483647), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '9', '2', '2', '3', '3', '7', '2', '0', '3', '6', '8', '5',
'4', '7', '7', '5', '8', '0', '8'}, 0, 20);
assertEquals(new DoubleWritable((double)-9223372036854775808L), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '9', '2', '2', '3', '3', '7', '2', '0', '3', '6', '8', '5',
'4', '7', '7', '5', '8', '0', '7'}, 0, 20);
assertEquals(new DoubleWritable((long)9223372036854775807L), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '3', '.', '7', '6', '8'}, 0, 6);
assertEquals(new DoubleWritable((double)-3.768), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '3', '.', '7', '6', '7'}, 0, 6);
assertEquals(new DoubleWritable((double)3.767), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '2', '.', '4', '7', '4', '8', '3', '6', 'e', '8'}, 0, 11);
assertEquals(new DoubleWritable((double)-2.474836e8), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '2', '.', '4', '7', '4', '8', '3', 'E', '-', '7'}, 0, 11);
assertEquals(new DoubleWritable((double)2.47483E-7), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '.', '4', '7', '4', '8', '3', '6', 'e', '8'}, 0, 10);
assertEquals(new DoubleWritable((double)-.474836e8), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '.', '4', '7', '4', '8', '3', 'E', '-', '7'}, 0, 10);
assertEquals(new DoubleWritable((double).47483E-7), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '2', '1', '4', '7', '4', '8', '3', '6', '4', '.'}, 0, 11);
assertEquals(new DoubleWritable((double)-214748364.), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '2', '1', '4', '7', '4', '8', '3', '6', '4', '.'}, 0, 11);
assertEquals(new DoubleWritable((double)+214748364.), b.getWritableObject());
initLazyObject(b,new byte[]{'.', '0'}, 0, 2);
assertEquals(new DoubleWritable((double).0), b.getWritableObject());
initLazyObject(b,new byte[]{'0', '.'}, 0, 2);
assertEquals(new DoubleWritable((double)0.), b.getWritableObject());
initLazyObject(b,new byte[]{'a', '1', 'b'}, 1, 2);
assertNull(b.getWritableObject());
assertNull(b.getWritableObject());
initLazyObject(b,new byte[]{'.', '1', '2', '3'}, 0, 1);
assertNull(b.getWritableObject());
initLazyObject(b,new byte[]{'-', '1', '2', '3'}, 0, 1);
assertNull(b.getWritableObject());
initLazyObject(b,new byte[]{'+', '1', '2', '3'}, 0, 1);
assertNull(b.getWritableObject());
initLazyObject(b,new byte[]{'-', '1', 'e', '3', '3', '3', '3', '3', '3'}, 0, 9);
assertEquals(new DoubleWritable(Double.NEGATIVE_INFINITY), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '1', 'e', '3', '3', '3', '3', '3', '3'}, 0, 9);
assertEquals(new DoubleWritable(Double.POSITIVE_INFINITY), b.getWritableObject());
initLazyObject(b,new byte[]{'+', '1', 'e', '-', '3', '3', '3', '3', '3'}, 0, 8);
assertEquals(new DoubleWritable((double)0), b.getWritableObject());
initLazyObject(b,new byte[]{'-', '1', 'e', '-', '3', '3', '3', '3', '3'}, 0, 8);
assertEquals(new DoubleWritable((double)-0.0), b.getWritableObject());
} catch (Throwable e) {
e.printStackTrace();
throw e;
}