@Test
public void testStreamToString() throws IOException {

    String tekst = "dit is een string";
    ByteArrayInputStream bais = new ByteArrayInputStream(tekst.getBytes());
    CloseChecker closeChecker = new CloseChecker(bais);
    String actual = Misc.streamToString(closeChecker);
    assertEquals(tekst, actual);
    assertTrue("inputstream was not closed", closeChecker.inputStreamClosed);
}