### Question:
JacksonMapper { public static <T> BodyReader<T> json(Class<T> type) { return INSTANCE.reader(type); } JacksonMapper(ObjectMapper mapper); static BodyReader<T> json(Class<T> type); static BodyWriter json(Object value); BodyReader<T> reader(Class<T> type); BodyWriter writer(Object value);  }### Answer:
@Test public void testToJson() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); json(new Hello("world")).writeTo(out); String s = new String(out.toByteArray()); assertThat(s, equalTo("{\"name\":\"world\"}")); }
@Test public void testFromJson() throws Exception { String json = "{\"name\":\"world\"}"; Hello hello = json(Hello.class).readFrom(new ByteArrayInputStream(json.getBytes())); assertThat(hello.getName(), equalTo("world")); }