@Test
    public void testClear() {
        Book book = getBook();
        assertTrue(Struct.class.isInstance(book.getMystruct()));
        assertTrue(List.class.isInstance(book.getMyarrayint()));
        assertEquals(book.getAuthor(), "Herman Melville");
        book.clear();
        assertNull(book.getMystruct());
        assertNull(book.getAuthor());
        assertNull(book.getMyarrayint());
        assertNull(book.getFieldValue("author"));
        assertNull(book.getFieldValue("mystruct"));
        assertNull(book.getFieldValue("myarrayint"));
    }
Tests vespa-documentgen-plugin

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