@Test
public void testSkip() throws IOException {

    final ByteArrayInputStream inputStream1 = new ByteArrayInputStream(new byte[20]);
    final SessionInputBuffer inBuffer1 = new SessionInputBufferImpl(16);
    final InputStream in1 = new ContentLengthInputStream(inBuffer1, inputStream1, 10L);
    Assert.assertEquals(10, in1.skip(10));
    Assert.assertTrue(in1.read() == -1);
    in1.close();
    final ByteArrayInputStream inputStream2 = new ByteArrayInputStream(new byte[20]);
    final SessionInputBuffer inBuffer2 = new SessionInputBufferImpl(16);
    final InputStream in2 = new ContentLengthInputStream(inBuffer2, inputStream2, 10L);
    in2.read();
    Assert.assertEquals(9, in2.skip(10));
    Assert.assertTrue(in2.read() == -1);
    in2.close();
    final ByteArrayInputStream inputStream3 = new ByteArrayInputStream(new byte[20]);
    final SessionInputBuffer inBuffer3 = new SessionInputBufferImpl(16);
    final InputStream in3 = new ContentLengthInputStream(inBuffer3, inputStream3, 2L);
    in3.read();
    in3.read();
    Assert.assertTrue(in3.skip(10) <= 0);
    Assert.assertTrue(in3.skip(-1) == 0);
    Assert.assertTrue(in3.read() == -1);
    in3.close();
    final ByteArrayInputStream inputStream4 = new ByteArrayInputStream(new byte[20]);
    final SessionInputBuffer inBuffer4 = new SessionInputBufferImpl(16);
    final InputStream in4 = new ContentLengthInputStream(inBuffer4, inputStream4, 10L);
    Assert.assertEquals(5,in4.skip(5));
    Assert.assertEquals(5, in4.read(new byte[20]));
    in4.close();
}