@Test
    public void testNestedArrayMatch() throws IOException {
        DocumentUpdate nested = parseUpdate("""
                                            {
                                              "update": "id:unittest:testArrayOfArrayOfInt::whee",
                                              "fields": {
                                                "arrayOfArrayOfInt": {
                                                  "match": {
                                                    "element": 1,
                                                    "match": {
                                                      "element": 2,
                                                      "assign": 3
                                                    }
                                                  }
                                                }
                                              }
                                            }
                                            """);

        DocumentUpdate equivalent = parseUpdate("""
                                                {
                                                  "update": "id:unittest:testArrayOfArrayOfInt::whee",
                                                  "fields": {
                                                    "arrayOfArrayOfInt": {
                                                      "match": {
                                                        "match": {
                                                          "assign": 3,
                                                          "element": 2
                                                        },
                                                        "element": 1
                                                      }
                                                    }
                                                  }
                                                }
                                                """);

        assertEquals(nested, equivalent);
        assertEquals(1, nested.fieldUpdates().size());
        FieldUpdate fu = nested.fieldUpdates().iterator().next();
        assertEquals(1, fu.getValueUpdates().size());
        MapValueUpdate mvu = (MapValueUpdate) fu.getValueUpdate(0);
        assertEquals(new IntegerFieldValue(1), mvu.getValue());
        MapValueUpdate nvu = (MapValueUpdate) mvu.getUpdate();
        assertEquals(new IntegerFieldValue(2), nvu.getValue());
        AssignValueUpdate avu = (AssignValueUpdate) nvu.getUpdate();
        assertEquals(new IntegerFieldValue(3), avu.getValue());

        Document doc = docFromJson("""
                                   {
                                     "put": "id:unittest:testArrayOfArrayOfInt::whee",
                                     "fields": {
                                       "arrayOfArrayOfInt": [
                                         [1, 2, 3],
                                         [4, 5, 6]
                                       ]
                                     }
                                   }
                                   """);
        nested.applyTo(doc);
        Document expected = docFromJson("""
                                        {
                                          "put": "id:unittest:testArrayOfArrayOfInt::whee",
                                          "fields": {
                                            "arrayOfArrayOfInt": [
                                              [1, 2, 3],
                                              [4, 5, 3]
                                            ]
                                          }
                                        }
                                        """);
        assertEquals(expected, doc);
    }
Basic test of JSON streams to Vespa document instances.

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