public final void removeInboundHandler() {
        checkAdded();
        inboundCtx.remove();
    }
@Test
    public void testInboundEvents() {
        InboundEventHandler inboundHandler = new InboundEventHandler();

        CombinedChannelDuplexHandler<ChannelInboundHandler, ChannelOutboundHandler> handler =
                new CombinedChannelDuplexHandler<ChannelInboundHandler, ChannelOutboundHandler>(
                inboundHandler, new ChannelOutboundHandlerAdapter());

        EmbeddedChannel channel = new EmbeddedChannel();
        channel.pipeline().addLast(handler);
        assertEquals(Event.HANDLER_ADDED, inboundHandler.pollEvent());

        doInboundOperations(channel);
        assertInboundOperations(inboundHandler);
        handler.removeInboundHandler();

        assertEquals(Event.HANDLER_REMOVED, inboundHandler.pollEvent());

        // These should not be handled by the inboundHandler anymore as it was removed before
        doInboundOperations(channel);

        // Should have not received any more events as it was removed before via removeInboundHandler()
        assertNull(inboundHandler.pollEvent());
        try {
            channel.checkException();
            fail();
        } catch (Throwable cause) {
            assertSame(CAUSE, cause);
        }

        assertTrue(channel.finish());
        assertNull(inboundHandler.pollEvent());
    }