@Test
public void testCapacityIncrease() {

    ByteBuf buffer = newBuffer(3, 13);
    assertEquals(13, buffer.maxCapacity());
    assertEquals(3, buffer.capacity());
    try {
        buffer.capacity(4);
        assertEquals(4, buffer.capacity());
        assertEquals(13, buffer.maxCapacity());
    } finally {
        buffer.release();
    }
}