@Test
    public void testArrays() {
        Book book = getBook();
        assertTrue(book.getField("myarrayint").getDataType() instanceof ArrayDataType);
        assertEquals(book.getMyarrayint().size(), 3);
        assertEquals(book.getMyarrayint().get(0), (Integer)10);
        assertEquals(book.getMyarrayint().get(1), (Integer)20);
        assertEquals(book.getMyarrayint().get(2), (Integer)30);
        Array<IntegerFieldValue> arrInt = (Array<IntegerFieldValue>) book.getFieldValue("myarrayint");
        for (Iterator<IntegerFieldValue> i = arrInt.fieldValueIterator() ; i.hasNext() ; ) {
            assertEquals(i.next().getWrappedValue(), 10);
            assertEquals(i.next().getWrappedValue(), 20);
            assertEquals(i.next().getWrappedValue(), 30);
            assertFalse(i.hasNext());
        }
        arrInt.set(1, new IntegerFieldValue(22));
        assertEquals(book.getMyarrayint().get(1), (Integer) 22);

        assertEquals(book.getMytriplearray().get(0).get(0).get(0), (Integer)1);
        assertEquals(book.getMytriplearray().get(0).get(0).get(1), (Integer)2);
        assertEquals(book.getMytriplearray().get(0).get(0).get(2), (Integer)3);
        assertEquals(book.getMytriplearray().get(0).get(1).get(0), (Integer)9);
        assertEquals(book.getMytriplearray().get(0).get(1).get(1), (Integer)10);
        assertEquals(book.getMytriplearray().get(0).get(1).get(2), (Integer)11);

        book.getMytriplearray().get(0).get(1).add(12);
        Array myTripleArray = (Array) book.getFieldValue("mytriplearray");
        IntegerFieldValue twelveFv = (IntegerFieldValue) ((Array)((Array) myTripleArray.getFieldValue(0)).getFieldValue(1)).getFieldValue(3);
        assertEquals(twelveFv.getWrappedValue(), 12);
        IntegerFieldValue twelve = (IntegerFieldValue) ((Array)((Array) myTripleArray.get(0)).get(1)).get(3);
        assertEquals(twelve, new IntegerFieldValue(12));
    }
Tests vespa-documentgen-plugin

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