@Override
    public SmileResponse<T> handle(Request request, Response response)
    {
        byte[] bytes = readResponseBytes(response);
        String contentType = response.getHeader(CONTENT_TYPE);
        if ((contentType == null) || !MediaType.parse(contentType).is(MEDIA_TYPE_SMILE)) {
            return new SmileResponse<>(response.getStatusCode(), response.getHeaders(), bytes);
        }
        return new SmileResponse<>(response.getStatusCode(), response.getHeaders(), smileCodec, bytes);
    }
@Test
    public void testValidSmile()
    {
        User user = new User("Joe", 25);
        byte[] smileBytes = codec.toBytes(user);
        SmileResponse<User> response = handler.handle(null, mockResponse(OK, MEDIA_TYPE_SMILE, smileBytes));

        assertTrue(response.hasValue());
        assertEquals(response.getSmileBytes(), smileBytes);
        assertEquals(response.getValue().getName(), user.getName());
        assertEquals(response.getValue().getAge(), user.getAge());

        assertNotSame(response.getSmileBytes(), response.getSmileBytes());
        assertNotSame(response.getResponseBytes(), response.getResponseBytes());

        assertEquals(response.getResponseBytes(), response.getSmileBytes());
    }