buf.capacity(32).clear();
Assert.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);
buf.compact();
Assert.assertEquals(32, buf.capacity());
Assert.assertEquals(9, buf.position());
Assert.assertEquals(32, buf.limit());
buf.clear();