/** char. */ @Test public void getChar() { ValueSerde serde = ValueSerdeFactory.getChar(10); HiveCharObjectInspector inspector = (HiveCharObjectInspector) serde.getInspector(); StringOption option = new StringOption("hello"); HiveChar value = new HiveChar("hello", 10); 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 HiveCharWritable(value))); assertThat(inspector.getPrimitiveWritableObject(null), is(nullValue())); ValueDriver driver = serde.getDriver(inspector); StringOption copy = new StringOption(); driver.set(copy, option); assertThat(copy, is(option)); driver.set(copy, null); assertThat(copy.isNull(), is(true)); }