@SuppressWarnings("rawtypes")
    @Test
    public void testArrayIndexing() throws IOException {
        DocumentUpdate doc = parseUpdate("""
                                         {
                                           "update": "id:unittest:testarray::whee",
                                           "fields": {
                                             "actualarray": {
                                               "match": {
                                                 "element": 3,
                                                 "assign": "nalle"
                                               }
                                             }
                                           }
                                         }
                                         """);

        Map<Number, String> matches = new HashMap<>();
        FieldUpdate x = doc.getFieldUpdate("actualarray");
        for (ValueUpdate v : x.getValueUpdates()) {
            MapValueUpdate adder = (MapValueUpdate) v;
            final Number key = ((IntegerFieldValue) adder.getValue())
                    .getNumber();
            String op = ((StringFieldValue) adder.getUpdate()
                    .getValue()).getString();
            matches.put(key, op);
        }
        assertEquals(1, matches.size());
        Number n = Integer.valueOf(3);
        assertEquals("nalle", matches.get(n));
    }
Basic test of JSON streams to Vespa document instances.

@author Steinar Knutsen
@author bratseth
document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java