### Question:
CoalescingBufferQueue extends AbstractCoalescingBufferQueue { public void releaseAndFailAll(Throwable cause) { releaseAndFailAll(channel, cause); } CoalescingBufferQueue(Channel channel);  CoalescingBufferQueue(Channel channel, int initSize); ByteBuf remove(int bytes, ChannelPromise aggregatePromise); void releaseAndFailAll(Throwable cause);  }### Answer:
@Test public void testReleaseAndFailAll() { writeQueue.add(cat, catPromise); writeQueue.add(mouse, mouseListener); RuntimeException cause = new RuntimeException("ooops"); writeQueue.releaseAndFailAll(cause); DefaultChannelPromise aggregatePromise = newPromise(); assertQueueSize(0, true); assertEquals(0, cat.refCnt()); assertEquals(0, mouse.refCnt()); assertSame(cause, catPromise.cause()); assertEquals("", dequeue(Integer.MAX_VALUE, aggregatePromise)); assertQueueSize(0, true); }