@Test
public void shouldCreateSuccessResponseWithStreamEntity() throws IOException {

    Response response = JSONResponse.createResponse(Status.OK, ENTITY_VALUE, null);
    assertThat(response.getStatus(), is(200));
    assertThat(response.getMediaType(), is(MediaType.APPLICATION_JSON_TYPE));
    Object entity = response.getEntity();
    assertThat(entity.getClass(), is(typeCompatibleWith(InputStream.class)));
    try (InputStream entityInStream = (InputStream) entity) {
        byte[] entityValue = new byte[ENTITY_JSON_VALUE.length()];
        entityInStream.read(entityValue);
        assertThat(new String(entityValue), is(ENTITY_JSON_VALUE));
    }
}