@Test(expected = NullPointerException.class)
  public void testNonNullableNullExtension() {
    Struct s = new StructBuilder().add(new RawStringTerminated("|")) // not nullable
      .toStruct();
    PositionedByteRange buf = new SimplePositionedMutableByteRange(4);
    s.encode(buf, new Object[1]);
  }
Verify null extension respects the type's isNullable field.
hbase-common/src/test/java/org/apache/hadoop/hbase/types/TestStructNullExtension.java