/** qualified decimal. */
  @Test
  public void getDecimal() {
    ValueSerde serde = ValueSerdeFactory.getDecimal(10, 2);
    HiveDecimalObjectInspector inspector = (HiveDecimalObjectInspector) serde.getInspector();

    DecimalOption option = new DecimalOption(new BigDecimal("123.45"));
    HiveDecimal value = HiveDecimal.create(new BigDecimal("123.45"));

    assertThat(inspector.copyObject(option), is((Object) option));
    assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
    assertThat(inspector.copyObject(null), is(nullValue()));
    assertThat(inspector.getPrimitiveJavaObject(option), is(value));
    assertThat(inspector.getPrimitiveJavaObject(null), is(nullValue()));
    assertThat(inspector.getPrimitiveWritableObject(option), is(new HiveDecimalWritable(value)));
    assertThat(inspector.getPrimitiveWritableObject(null), is(nullValue()));

    ValueDriver driver = serde.getDriver(inspector);
    DecimalOption copy = new DecimalOption();

    driver.set(copy, option);
    assertThat(copy, is(option));
    driver.set(copy, null);
    assertThat(copy.isNull(), is(true));
  }