@Test
public void writesByteArrayToOutputStream() throws Exception {

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    byteEntityProvider.writeTo(testContent, byte[].class, null, null, MediaType.WILDCARD_TYPE, new MultivaluedHashMap<>(), out);
    assertArrayEquals(testContent, out.toByteArray());
}