@Test
public void testSkip() throws IOException {

	ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
		_BUFFER);
	int size = 10;
	UnsyncBufferedInputStream unsyncBufferedInputStream =
		new UnsyncBufferedInputStream(byteArrayInputStream, size);
	// Zero skip
	Assert.assertEquals(0, unsyncBufferedInputStream.skip(0));
	Assert.assertEquals(_SIZE, byteArrayInputStream.available());
	Assert.assertEquals(_SIZE, unsyncBufferedInputStream.available());
	// Negative skip
	Assert.assertEquals(0, unsyncBufferedInputStream.skip(-1));
	Assert.assertEquals(_SIZE, byteArrayInputStream.available());
	Assert.assertEquals(_SIZE, unsyncBufferedInputStream.available());
	// Load data into buffer
	Assert.assertEquals(0, unsyncBufferedInputStream.read());
	Assert.assertEquals(_SIZE - size, byteArrayInputStream.available());
	Assert.assertEquals(_SIZE - 1, unsyncBufferedInputStream.available());
	// In-memory
	Assert.assertEquals(size - 1, unsyncBufferedInputStream.skip(size * 2));
	Assert.assertEquals(10, unsyncBufferedInputStream.read());
	Assert.assertEquals(size - 1, unsyncBufferedInputStream.skip(size * 2));
	// Underlying input stream
	Assert.assertEquals(size * 2, unsyncBufferedInputStream.skip(size * 2));
	Assert.assertEquals(40, unsyncBufferedInputStream.read());
	// Clear out buffer
	Assert.assertEquals(size - 1, unsyncBufferedInputStream.skip(size));
	// Mark
	unsyncBufferedInputStream.mark(size * 2);
	// Load data into buffer for skipping
	Assert.assertEquals(size, unsyncBufferedInputStream.skip(size * 2));
	// In-memory
	Assert.assertEquals(size / 2, unsyncBufferedInputStream.skip(size / 2));
	unsyncBufferedInputStream.reset();
	Assert.assertEquals(50, unsyncBufferedInputStream.read());
	// Clear out buffer
	Assert.assertEquals(
		(size * 2) - 1, unsyncBufferedInputStream.skip(size * 2));
	// Mark a large size for EOF
	unsyncBufferedInputStream.mark(_SIZE);
	// Consume all the data
	while (unsyncBufferedInputStream.read() != -1);
	// Skip on EOF
	Assert.assertEquals(0, unsyncBufferedInputStream.skip(1));
}