JacksonObjectMapper { public <T> T fromJson(byte[] bytes, Class<T> type) throws IOException { return objectMapper.readValue(bytes, type); } JacksonObjectMapper(ObjectMapper objectMapper); T fromJson(byte[] bytes, Class<T> type); T fromJson(byte[] bytes, Class<T> type, Class<?> view); Map<String, String> fromJsonToMap(byte[] bytes); byte[] toJson(Object object); byte[] toJson(Object object, Class<?> serializationView); byte[] toJson(Map<String, String> map); byte[] toPrettyJson(Object object, Class<?> serializationView); String prettyPrint(Object object); String prettyPrint(String json); void checkValidJson(byte[] bytes); T assign(T target, byte[] source);  }
@Test public void should_deserialize_json() throws Exception { String json = "{\"name\": \"colin\", \"number\": 31}"; SimpleObject object = objectMapper.fromJson(json.getBytes(StandardCharsets.UTF_8), SimpleObject.class); assertThat(object.getName()).isEqualTo("colin"); assertThat(object.getNumber()).isEqualTo(31); }