@Test
    void testWeightedSetFromInspector() {
        Value.ArrayValue top = new Value.ArrayValue();
        top.add(new Value.ArrayValue()
                .add(new Value.ObjectValue()
                        .put("d1", new Value.DoubleValue(87.790001))
                        .put("s1", new Value.StringValue("string\n" + "espa\u00F1a\n" + "wssf1.s1[0]"))
                        .put("al1", new Value.ArrayValue()
                                .add(new Value.LongValue(11223344556677881L))
                                .add(new Value.LongValue(11223344556677883L)))
                        .put("l1", new Value.LongValue(1122334455667788997L))
                        .put("as1", new Value.ArrayValue()
                                .add(new Value.StringValue("per"))
                                .add(new Value.StringValue("paal")))
                        .put("i1", new Value.LongValue(7)))
                .add(new Value.LongValue(10)))
                .add(new Value.ArrayValue()
                        .add(new Value.ObjectValue()
                                .put("d1", new Value.DoubleValue(88.790001))
                                .put("s1", new Value.StringValue("string\n" + "espa\u00F1a wssf1.s1[1]"))
                                .put("al1", new Value.ArrayValue()
                                        .add(new Value.LongValue(11223344556677881L))
                                        .add(new Value.LongValue(11223344556677883L)))
                                .put("l1", new Value.LongValue(1122334455667788998L))
                                .put("as1", new Value.ArrayValue()
                                        .add(new Value.StringValue("per"))
                                        .add(new Value.StringValue("paal")))
                                .put("i1", new Value.LongValue(8)))
                        .add(new Value.LongValue(20)));

        JSONString js = new JSONString(top);
        String correct = "\n"
                + "      <item weight=\"10\">\n"
                + "        <struct-field name=\"d1\">87.790001</struct-field>\n"
                + "        <struct-field name=\"s1\">string\n"
                + "espa\u00F1a\n"
                + "wssf1.s1[0]</struct-field>\n"
                + "        <struct-field name=\"al1\">\n"
                + "          <item>11223344556677881</item>\n"
                + "          <item>11223344556677883</item>\n"
                + "        </struct-field>\n"
                + "        <struct-field name=\"l1\">1122334455667788997</struct-field>\n"
                + "        <struct-field name=\"as1\">\n"
                + "          <item>per</item>\n"
                + "          <item>paal</item>\n"
                + "        </struct-field>\n"
                + "        <struct-field name=\"i1\">7</struct-field>\n"
                + "      </item>\n"
                + "      <item weight=\"20\">\n"
                + "        <struct-field name=\"d1\">88.790001</struct-field>\n"
                + "        <struct-field name=\"s1\">string\n"
                + "espa\u00F1a wssf1.s1[1]</struct-field>\n"
                + "        <struct-field name=\"al1\">\n"
                + "          <item>11223344556677881</item>\n"
                + "          <item>11223344556677883</item>\n"
                + "        </struct-field>\n"
                + "        <struct-field name=\"l1\">1122334455667788998</struct-field>\n"
                + "        <struct-field name=\"as1\">\n"
                + "          <item>per</item>\n"
                + "          <item>paal</item>\n"
                + "        </struct-field>\n"
                + "        <struct-field name=\"i1\">8</struct-field>\n"
                + "      </item>\n"
                + "    ";
        assertEquals(correct, js.renderFromInspector());

        top = new Value.ArrayValue();
        top.add(new Value.ArrayValue()
                .add(new Value.StringValue("s1"))
                .add(new Value.LongValue(10)))
                .add(new Value.ArrayValue()
                        .add(new Value.StringValue("s2"))
                        .add(new Value.LongValue(20)));
        js = new JSONString(top);
        correct = "\n" +
                "      <item weight=\"10\">s1</item>\n" +
                "      <item weight=\"20\">s2</item>\n" +
                "    ";
        assertEquals(correct, js.renderFromInspector());
    }
Tests the JSONString XML rendering.

TODO: Add correct answers. These are not added because this code was checked in before sync with system test

@author Steinar Knutsen
container-search/src/test/java/com/yahoo/prelude/hitfield/test/JSONStringTestCase.java