### Question:
CoalescingBufferQueue extends AbstractCoalescingBufferQueue { public ByteBuf remove(int bytes, ChannelPromise aggregatePromise) { return remove(channel.alloc(), bytes, aggregatePromise); } CoalescingBufferQueue(Channel channel);  CoalescingBufferQueue(Channel channel, int initSize); ByteBuf remove(int bytes, ChannelPromise aggregatePromise); void releaseAndFailAll(Throwable cause);  }### Answer:
@Test public void testReadExactAddedBufferSizeReturnsOriginal() { writeQueue.add(cat, catPromise); writeQueue.add(mouse, mouseListener); DefaultChannelPromise aggregatePromise = newPromise(); assertSame(cat, writeQueue.remove(3, aggregatePromise)); assertFalse(catPromise.isSuccess()); aggregatePromise.setSuccess(); assertTrue(catPromise.isSuccess()); assertEquals(1, cat.refCnt()); cat.release(); aggregatePromise = newPromise(); assertSame(mouse, writeQueue.remove(5, aggregatePromise)); assertFalse(mouseDone); aggregatePromise.setSuccess(); assertTrue(mouseSuccess); assertEquals(1, mouse.refCnt()); mouse.release(); }