@Test
public void writesUtf8ReaderToOutputStream() throws Exception {

    MediaType mediaType = new MediaType("text", "plain");
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    readerEntityProvider.writeTo(new StringReader(TEST_CONTENT), String.class, null, null, mediaType, new MultivaluedHashMap<>(), out);
    assertArrayEquals(TEST_CONTENT.getBytes("UTF-8"), out.toByteArray());
}