@Test
public void testAsList() {

	final RingBuffer<Integer> ring = new RingBufferSimple<Integer>(10);
	assertEquals(ring.length(), 10);
	ring.setHead(100, 100);
	for (int k = 100; k < 110; k++) {
		ring.set(k, k);
	}
	ring.set(102, null);
	ring.set(107, null);
	assertEquals(ring.count(), 8);
	final List<Integer> list = ring.asList();
	assertEquals(list.size(), ring.count());
	int index = 0;
	for (int k = 100; k < 110; k++) {
		final Integer ringItem = ring.get(k);
		if (ringItem == null) {
			continue;
		}
		final Integer listItem = list.get(index++);
		assertEquals(ringItem, listItem);
	}
}