@Test
    public void clearing_document_nulls_out_reference_id() {
        final Book book = getBook();
        book.setRef(new DocumentId("id:ns:parent::foo"));
        book.clear();

        assertNull(book.getRef());
    }
Tests vespa-documentgen-plugin

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