### Question:
JsonConverter { public String toJson(ResponseBlock response) { Validate.notNull(response); return gson.toJson(response, ResponseBlock.class); } JsonConverter(); String toJson(ResponseBlock response); RequestBlock fromJson(String request);  }### Answer:
@Test public void mustGenerateResponseBlockToJsonString() { ResponseBlock rb = new ResponseBlock(Arrays.asList( new Message("a:a1", "b:b1", "payload1"), new Message("a:a2", "b:b2", "payload2") )); String json = fixture.toJson(rb); assertEquals("{\"outQueue\":[{\"source\":\"a:a1\",\"destination\":\"b:b1\",\"type\":\"java.lang.String\",\"data\":\"payload1\"},{\"source\":\"a:a2\",\"destination\":\"b:b2\",\"type\":\"java.lang.String\",\"data\":\"payload2\"}]}", json); }