@Test
public void defaultEncodingInitialization()
        throws UnsupportedEncodingException {

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