### Question:
IcebergDecimalObjectInspector extends AbstractPrimitiveJavaObjectInspector implements HiveDecimalObjectInspector { private IcebergDecimalObjectInspector(int precision, int scale) { super(new DecimalTypeInfo(precision, scale)); } private  IcebergDecimalObjectInspector(int precision, int scale); static IcebergDecimalObjectInspector get(int precision, int scale); @Override HiveDecimal getPrimitiveJavaObject(Object o); @Override HiveDecimalWritable getPrimitiveWritableObject(Object o); @Override Object copyObject(Object o);  }### Answer:
@Test public void testIcebergDecimalObjectInspector() { HiveDecimalObjectInspector oi = IcebergDecimalObjectInspector.get(38, 18); Assert.assertEquals(ObjectInspector.Category.PRIMITIVE, oi.getCategory()); Assert.assertEquals(PrimitiveObjectInspector.PrimitiveCategory.DECIMAL, oi.getPrimitiveCategory()); Assert.assertEquals(new DecimalTypeInfo(38, 18), oi.getTypeInfo()); Assert.assertEquals(TypeInfoFactory.decimalTypeInfo.getTypeName(), oi.getTypeName()); Assert.assertEquals(38, oi.precision()); Assert.assertEquals(18, oi.scale()); Assert.assertEquals(HiveDecimal.class, oi.getJavaPrimitiveClass()); Assert.assertEquals(HiveDecimalWritable.class, oi.getPrimitiveWritableClass()); Assert.assertNull(oi.copyObject(null)); Assert.assertNull(oi.getPrimitiveJavaObject(null)); Assert.assertNull(oi.getPrimitiveWritableObject(null)); HiveDecimal one = HiveDecimal.create(BigDecimal.ONE); Assert.assertEquals(one, oi.getPrimitiveJavaObject(BigDecimal.ONE)); Assert.assertEquals(new HiveDecimalWritable(one), oi.getPrimitiveWritableObject(BigDecimal.ONE)); HiveDecimal copy = (HiveDecimal) oi.copyObject(one); Assert.assertEquals(one, copy); Assert.assertNotSame(one, copy); Assert.assertFalse(oi.preferWritable()); }