@Test
    public void testWeightedSet() throws IOException {
        Document doc = docFromJson("""
                                   {
                                     "put": "id:unittest:testset::whee",
                                     "fields": {
                                       "actualset": {
                                         "nalle": 2,
                                         "tralle": 7
                                       }
                                     }
                                   }
                                   """);
        FieldValue f = doc.getFieldValue(doc.getField("actualset"));
        assertSame(WeightedSet.class, f.getClass());
        WeightedSet<?> w = (WeightedSet<?>) f;
        assertEquals(2, w.size());
        assertEquals(Integer.valueOf(2), w.get(new StringFieldValue("nalle")));
        assertEquals(Integer.valueOf(7), w.get(new StringFieldValue("tralle")));
    }
Basic test of JSON streams to Vespa document instances.

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