@Test
public void testClose() throws IOException {

    final String s = "1234567890123456-";
    final ByteArrayInputStream inputStream = new ByteArrayInputStream(s.getBytes(StandardCharsets.ISO_8859_1));
    final SessionInputBuffer inBuffer = new SessionInputBufferImpl(16);
    final InputStream in = new ContentLengthInputStream(inBuffer, inputStream, 16L);
    in.close();
    in.close();
    try {
        in.read();
        Assert.fail("StreamClosedException expected");
    } catch (final StreamClosedException expected) {
    }
    final byte[] tmp = new byte[10];
    try {
        in.read(tmp);
        Assert.fail("StreamClosedException expected");
    } catch (final StreamClosedException expected) {
    }
    try {
        in.read(tmp, 0, tmp.length);
        Assert.fail("StreamClosedException expected");
    } catch (final StreamClosedException expected) {
    }
    Assert.assertEquals('-', inBuffer.read(inputStream));
}