ConnectionMessage extends Message<Boolean> { @Override public String toJson() { return writeValueAsString(this); } ConnectionMessage(boolean body); @Override String toJson();  }
@Test public void testToJson() { ConnectionMessage connectionMessage = new ConnectionMessage(true); assertEquals("{\"body\":true,\"type\":\"connection\"}", connectionMessage.toJson()); }