@Test
public void overwritingEncodingInitialization()
        throws UnsupportedEncodingException {

    // setup: any default encoding
    final String anyEncoding = availableCharsets[0].name();
    final InputStream istream = new ByteArrayInputStream(new byte[] {});
    final InputStreamReader ireader = new InputStreamReader(istream,
            anyEncoding);
    // test: overwrite with different encoding
    final String overwrittenEncoding = availableCharsets[1].name();
    final ReaderResource iresource = new ReaderResource(ireader,
            overwrittenEncoding, null);
    // assert
    assertEquals(overwrittenEncoding, iresource.getEncoding());
    assertNotEquals(ireader.getEncoding(), iresource.getEncoding());
}