@Test
    public void testJsonMarshalling_DuplicateValues() throws JsonParseException, JsonMappingException, IOException {
        HeaderMap map = new HeaderMap();
        map.add("foo", "val");
        map.add("foo", "val2");
        map.add("weeble", "wobble");
        map.add("savy", "marc");
        map.add("savy", "alain");
        map.add("savy", "yvon");
        map.add("Single", "thing");

        ObjectMapper mapper = new ObjectMapper();
        String actualWritten = mapper.writeValueAsString(map);
        Assert.assertEquals("{\"foo\":[\"val2\",\"val\"],\"savy\":[\"yvon\",\"alain\",\"marc\"],\"Single\":\"thing\",\"weeble\":\"wobble\"}",
                actualWritten);

        HeaderMap deserializedMap = mapper.readValue(actualWritten, HeaderMap.class);

       Assert.assertThat(deserializedMap.getAll("foo"), Matchers.hasItems("val2", "val"));
       Assert.assertThat(deserializedMap.getAll("savy"), Matchers.hasItems("marc", "alain", "yvon"));
       Assert.assertThat(deserializedMap.getAll("weeble"), Matchers.hasItems("wobble"));
       Assert.assertEquals(deserializedMap.get("Single"), "thing");
       Assert.assertEquals(deserializedMap.get("savy"), "yvon");
    }
Test method for {@link io.apiman.gateway.engine.beans.util.CaseInsensitiveStringMultiMap#toString()}.
gateway/engine/beans/src/test/java/io/apiman/gateway/engine/beans/util/HeaderMapIOTest.java