@Test
public void readsContentOfEntityStreamAsString() throws Exception {

    MediaType mediaType = new MediaType("text", "plain", ImmutableMap.of("charset", "windows-1251"));
    byte[] data = TEST_CONTENT.getBytes("windows-1251");
    String result = stringEntityProvider.readFrom(String.class, String.class, null, mediaType, null, new ByteArrayInputStream(data));
    assertEquals(TEST_CONTENT, result);
}