@Test
public void testAsMap() {

	final RingBuffer<Integer> ring = new RingBufferSimple<Integer>(10);
	assertEquals(ring.length(), 10);
	ring.setHead(100, 100);
	for (int k = 101; k < 110; k++) {
		ring.set(k, k);
	}
	ring.set(102, null);
	ring.set(107, null);
	assertEquals(ring.count(), 8);
	final Map<Integer, Integer> map = ring.asMap();
	assertEquals(map.size(), ring.count());
	// SortedMap<Integer, Integer> map1 = new TreeMap<Integer,
	// Integer>(map);
	for (int k = 100; k < 110; k++) {
		final Integer ringItem = ring.get(k);
		final Integer mapItem = map.get(k);
		assertEquals(ringItem, mapItem);
	}
}