@Test
    public void testUpdateMatch() throws IOException {
        DocumentUpdate doc = parseUpdate("""
                                         {
                                           "update": "id:unittest:testset::whee",
                                           "fields": {
                                             "actualset": {
                                               "match": {
                                                 "element": "person",
                                                 "increment": 13
                                               }
                                             }
                                           }
                                         }
                                         """);

        DocumentUpdate otherDoc = parseUpdate("""
                                              {
                                                "update": "id:unittest:testset::whee",
                                                "fields": {
                                                  "actualset": {
                                                    "match": {
                                                      "increment": 13,
                                                      "element": "person"
                                                    }
                                                  }
                                                }
                                              }""");

        assertEquals(doc, otherDoc);

        Map<String, Tuple2<Number, String>> matches = new HashMap<>();
        FieldUpdate x = doc.getFieldUpdate("actualset");
        for (ValueUpdate<?> v : x.getValueUpdates()) {
            MapValueUpdate adder = (MapValueUpdate) v;
            final String key = ((StringFieldValue) adder.getValue())
                    .getString();
            String op = ((ArithmeticValueUpdate) adder.getUpdate())
                    .getOperator().toString();
            Number n = ((ArithmeticValueUpdate) adder.getUpdate()).getOperand();
            matches.put(key, new Tuple2<>(n, op));
        }
        assertEquals(1, matches.size());
        final String o = "person";
        assertEquals("ADD", matches.get(o).second);
        assertEquals(Double.valueOf(13), matches.get(o).first);
    }
Basic test of JSON streams to Vespa document instances.

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