assertEquals(8, buf.capacity());
assertEquals(0, buf.position());
assertEquals(8, buf.limit());
// Expand the buffer.
buf.capacity(32).clear();
assertEquals(32, buf.capacity());
// Make sure the buffer doesn't shrink when more than 1/4 is being used.
buf.sweep((byte) 1);
buf.fill(23);