### Question:
JsonPayloadIO implements IPayloadIO<Map> { @Override public byte[] marshall(Map data) throws Exception { String dataAsString = mapper.writeValueAsString(data); return dataAsString.getBytes("UTF8"); } JsonPayloadIO(); @Override Map unmarshall(InputStream input); @Override Map unmarshall(byte[] input); @Override byte[] marshall(Map data);  }### Answer:
@Test public void testMarshall_Simple() throws Exception { Map<String, Comparable> data = new LinkedHashMap<>(); data.put("hello", "world"); data.put("foo", "bar"); data.put("bool", true); JsonPayloadIO io = new JsonPayloadIO(); byte[] bytes = io.marshall(data); String actual = new String(bytes); String expected = "{\"hello\":\"world\",\"foo\":\"bar\",\"bool\":true}"; Assert.assertEquals(expected, actual); }