### Question:
JsonMessageConverter implements MessageConverter { @Override public String toDDP(final Object object) { final String json = GSON.toJson(object, object.getClass()); final StringBuilder buffer = new StringBuilder(json); buffer.insert(1, "\"msg\":\"" + MessageRegistry.get(object.getClass()) + "\","); return buffer.toString(); }  @Override Object fromDDP(final String rawMessage); @Override String toDDP(final Object object);  }### Answer:
@Test public void testConversionToDdp() throws Exception { MyTestClass foo = new MyTestClass(); foo.setName("Hello, world!"); foo.setDate(new Date()); JsonMessageConverter converter = new JsonMessageConverter(); String result = converter.toDDP(foo); System.out.println(result); Assert.assertTrue(result.contains("Hello, world!")); }