@Test
    @Timeout(300)
    void testWsetInFields() throws IOException, InterruptedException, ExecutionException {
        Result r = new Result(new Query("/?renderer.json.jsonWsets=true"));
        var expected = dataFromSimplified(
                "{root: { id:'toplevel', relevance:1.0, fields: { totalCount: 1 }," +
                        "  children: [ { id: 'myHitName', relevance: 1.0," +
                        "    fields: { " +
                        "      f1: [ 'v1', { mykey1: 10, mykey2: 20 } ]," +
                        "      f2: { i1: 'v2', i2: { mykey3: 30 }, i3: 'v3' }," +
                        "      f3: { j1: 42, j2: 17.75, j3: [ 'v4', 'v5' ] }," +
                        "      f4: { mykey4: 40, mykey5: 50 }" +
                        "    }" +
                        "  } ]" +
                        "}}");
        Hit h = new Hit("myHitName");
        h.setField("f1", dataFromSimplified("[ 'v1', [ { item: 'mykey1', weight: 10 }, { item: 'mykey2', weight: 20 } ] ]"));
        h.setField("f2", dataFromSimplified("{ i1: 'v2', i2: [ { item: 'mykey3', weight: 30 } ], i3: 'v3' }"));
        h.setField("f3", dataFromSimplified("{ j1: 42, j2: 17.75, j3: [ 'v4', 'v5' ] }"));
        h.setField("f4", dataFromSimplified("[ { item: 'mykey4', weight: 40 }, { item: 'mykey5', weight: 50 } ]"));
        r.hits().add(h);
        r.setTotalHitCount(1L);
        String summary = render(r);
        assertEqualJson(expected.toString(), summary);

        r = new Result(new Query("/?renderer.json.jsonWsets=false"));
        expected = dataFromSimplified(
                "{root:{id:'toplevel',relevance:1.0,fields:{totalCount:1}," +
                        "  children: [ { id: 'myHitName', relevance: 1.0," +
                        "    fields: { " +
                        "      f1: [ 'v1', [ { item: 'mykey1', weight: 10 }, { item: 'mykey2', weight: 20 } ] ]," +
                        "      f2: { i1: 'v2', i2: [ { item: 'mykey3', weight: 30 } ], i3: 'v3' }," +
                        "      f3: { j1: 42, j2: 17.75, j3: [ 'v4', 'v5' ] }," +
                        "      f4: [ { item: 'mykey4', weight: 40 }, { item: 'mykey5', weight: 50 } ]" +
                        "    }" +
                        "  } ]" +
                        "}}");
        r.hits().add(h);
        r.setTotalHitCount(1L);
        summary = render(r);
        assertEqualJson(expected.toString(), summary);
    }
Functional testing of {@link JsonRenderer}.

@author Steinar Knutsen
@author bratseth
container-search/src/test/java/com/yahoo/search/rendering/JsonRendererTestCase.java