private void assertBook(Book book) {
        assertTrue(Struct.class.isInstance(book.getMystruct()));
        assertEquals(-238472634.78, book.getMystruct().getSs01().getD0(), 0);
        assertEquals((Integer)999, book.getMystruct().getI1());
        assertEquals(book.getAuthor(), "Herman Melville");
        book.getMystruct().getSs01().setD0(4d);
        assertEquals(book.getMystruct().getSs01().getD0(), 4.0, 1E-6);
        book.getMystruct().setS1("new s1");
        assertEquals(book.getMystruct().getS1(), "new s1");
        assertEquals(((StructuredFieldValue)book.getFieldValue("mystruct")).getField("s1").getDataType(), DataType.STRING);
        assertSame(((StructuredFieldValue)book.getFieldValue("mystruct")).getField("s1").getDataType(), ((StructuredFieldValue)book.getFieldValue("mystruct")).getField("s1").getDataType());
        FieldValue old = book.getMystruct().setFieldValue(((StructuredFieldValue)book.getFieldValue("mystruct")).getField("s1"), new StringFieldValue("TJO"));
        assertEquals(old.getWrappedValue(), "new s1");
        assertEquals(book.getMystruct().getS1(), "TJO");
        assertEquals(book.getMystruct().getFieldValue("s1").getWrappedValue(), "TJO");
    }
Tests vespa-documentgen-plugin

@author vegardh
documentgen-test/src/test/java/com/yahoo/vespa/config/DocumentGenPluginTest.java