@Test
public void testRemoveAndFail() {

    assertWriteFails(new TestHandler() {
        @Override
        public void flush(ChannelHandlerContext ctx) throws Exception {
            queue.removeAndFail(new TestException());
            super.flush(ctx);
        }
    }, 1);
}