@Test
public void testHandleInboundMessage() throws InterruptedException {

    final CountDownLatch latch = new CountDownLatch(1);
    EmbeddedChannel channel = new EmbeddedChannel() {
        @Override
        protected void handleInboundMessage(Object msg) {
            latch.countDown();
        }
    };
    channel.writeOneInbound("Hello, Netty!");
    if (!latch.await(1L, TimeUnit.SECONDS)) {
        fail("Nobody called #handleInboundMessage() in time.");
    }
}