@Test
public void testValidJson()
{

    User user = new User("Joe", 25);
    String json = codec.toJson(user);
    JsonResponse<User> response = handler.handle(null, mockResponse().contentType(JSON_UTF_8).body(json).build());
    assertTrue(response.hasValue());
    assertEquals(response.getJsonBytes(), json.getBytes(StandardCharsets.UTF_8));
    assertEquals(response.getJson(), json);
    assertEquals(response.getValue().getName(), user.getName());
    assertEquals(response.getValue().getAge(), user.getAge());
    assertNotSame(response.getJson(), response.getJson());
    assertNotSame(response.getJsonBytes(), response.getJsonBytes());
    assertNotSame(response.getResponseBytes(), response.getResponseBytes());
    assertNotSame(response.getResponseBody(), response.getResponseBody());
    assertEquals(response.getResponseBytes(), response.getJsonBytes());
    assertEquals(response.getResponseBody(), response.getJson());
}