@Test
    void testArrayOfStructWithEmptyMap() {
        String json = "[{\"asf\":\"here is 1st simple string field\",\"map\":[],\"sf2\":\"here is 2nd simple string field\"},{\"asf\":\"here is 3rd simple string field\",\"map\":[],\"sf2\":\"here is 4th simple string field\"}]";


        JSONString js = new JSONString(json);
        String correct = "\n"
                + "      <item>\n"
                + "        <struct-field name=\"asf\">here is 1st simple string field</struct-field>\n"
                + "        <struct-field name=\"map\"></struct-field>\n"
                + "        <struct-field name=\"sf2\">here is 2nd simple string field</struct-field>\n"
                + "      </item>\n"
                + "      <item>\n"
                + "        <struct-field name=\"asf\">here is 3rd simple string field</struct-field>\n"
                + "        <struct-field name=\"map\"></struct-field>\n"
                + "        <struct-field name=\"sf2\">here is 4th simple string field</struct-field>\n"
                + "      </item>\n"
                + "    ";
        assertEquals(correct, js.toString());

        Inspector top = new Value.ArrayValue()
                .add(new Value.ObjectValue()
                        .put("asf", "here is 1st simple string field")
                        .put("map", new Value.ArrayValue())
                        .put("sf2", "here is 2nd simple string field"))
                .add(new Value.ObjectValue()
                        .put("asf", "here is 3rd simple string field")
                        .put("map", new Value.ArrayValue())
                        .put("sf2", "here is 4th simple string field"));
        js = new JSONString(top);
        assertEquals(correct, js.renderFromInspector());

    }
and here is some corresponding XML
     
          <item>
          <struct-field name="asf">here is 1st simple string field</struct-field>
          <struct-field name="map">
          <item><key>one key string</key><value>
          <item>one value string</item>
          <item>embedded array</item>
          </value></item>
          <item><key>two key string</key><value>
          <item>two value string</item>
          <item>embedded array</item>
          </value></item>
          </struct-field>
          <struct-field name="sf2">here is 2nd simple string field</struct-field>
          </item>
          <item>
          <struct-field name="asf">here is 3rd simple string field</struct-field>
          <struct-field name="map">
          <item><key>three key string</key><value>
          <item>three value string</item>
          <item>embedded array</item>
          </value></item>
          <item><key>four key string</key><value>
          <item>four value string</item>
          <item>embedded array</item>
          </value></item>
          </struct-field>
          <struct-field name="sf2">here is 4th simple string field</struct-field>
          </item>
*
container-search/src/test/java/com/yahoo/prelude/hitfield/test/JSONStringTestCase.java