@Test
public void testAsArray() {

	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 Integer[] clone1 = ring.asArray(Integer.class);
	final Integer[] clone2 = ring.asArray(Integer.class);
	assertFalse(clone1 == clone2);
	assertTrue(Arrays.equals(clone1, clone2));
	for (int k = 0; k < 10; k++) {
		assertEquals(ring.get(100 + k), clone1[k]);
		assertEquals(ring.get(100 + k), clone2[k]);
	}
}