@Test
public void testInitialAllocations()
{

    Slab slab = new Slab(0, SLAB_SIZE, PAGE_SIZE);
    int[] arrayOffsets = new int[PAGES];
    for (int p = 0; p < PAGES; p++) {
        ByteBuffer buffer = slab.takePageBuffer();
        assertNotNull(buffer);
        assertEquals(0, buffer.position());
        assertEquals(PAGE_SIZE, buffer.limit());
        arrayOffsets[p] = buffer.arrayOffset();
    }
    assertNull(slab.takePageBuffer());
    Arrays.sort(arrayOffsets);
    int expectedArrayOffset = 0;
    for (int b = 0; b < PAGES; b++) {
        assertEquals(expectedArrayOffset, arrayOffsets[b]);
        expectedArrayOffset += PAGE_SIZE;
    }
}