@Override
    public int maxCapacity() {
        return maxCapacity;
    }
@Test
    public void testCapacityNegative() {
        final ByteBuf buffer = newBuffer(3, 13);
        assertEquals(13, buffer.maxCapacity());
        assertEquals(3, buffer.capacity());
        try {
            assertThrows(IllegalArgumentException.class, new Executable() {
                @Override
                public void execute() {
                    buffer.capacity(-1);
                }
            });
        } finally {
            buffer.release();
        }
    }