@Test
    public void testRemoveFieldValue() {
        Book book = getBook();
        book.setAuthor(null);
        Field a = new Field("author", DataType.STRING);
        assertNull(book.getFieldValue("author"));
        assertNull(book.getFieldValue(a));
        assertEquals(book.getField("author"), a);
        assertNull(book.getFieldValue(a));
        assertNull(book.getFieldValue("author"));
        assertNull(book.getFieldValue("author"));

        book.removeFieldValue("isbn");
        book.removeFieldValue(new Field("year", DataType.INT));
        book.removeFieldValue(new Field("description", DataType.STRING));
        Array old = (Array) book.removeFieldValue("myarrayint");
        assertEquals(old.get(0), new IntegerFieldValue(10));
        book.removeFieldValue("stringmap");
        book.removeFieldValue("mywsinteger");
        assertNull(book.getIsbn());
        assertNull(book.getYear());
        assertNull(book.getDescription());
        assertNull(book.getStringmap());
        assertNull(book.getMyarrayint());
        assertNull(book.getMywsinteger());

        Music music = getMusicBasic();
        Field artist = music.getField("artist");
        Field year = music.getField("year");
        music.removeFieldValue(artist);
        assertNull(music.getArtist());
        music.removeFieldValue("disp_song");
        assertNull(music.getDisp_song());
        music.removeFieldValue(year);
        assertNull(music.getYear());
        music.removeFieldValue("uri");
        assertNull(music.getUri());
        music.removeFieldValue("weight_src");
        assertNull(music.getWeight_src());
    }
Tests vespa-documentgen-plugin

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