@Test
public void testFlushOutbound() throws InterruptedException {

    final CountDownLatch latch = new CountDownLatch(1);
    EmbeddedChannel channel = new EmbeddedChannel(new ChannelOutboundHandlerAdapter() {
        @Override
        public void flush(ChannelHandlerContext ctx) throws Exception {
            latch.countDown();
        }
    });
    channel.flushOutbound();
    if (!latch.await(1L, TimeUnit.SECONDS)) {
        fail("Nobody called #flush() in time.");
    }
}