@Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        ChannelPipeline p = socketChannel.pipeline();

        p.addLast(new HttpRequestDecoder());
        p.addLast(new HttpObjectAggregator(1024 * 1024));
        p.addLast(new HttpResponseEncoder());

        p.addLast(new HttpServerHandler());
    }
@Test
    public void testInitChannel() throws Exception {
        // Mock Objects
        HttpServerInitializer httpServerInitializer = mock(HttpServerInitializer.class);
        SocketChannel socketChannel = mock(SocketChannel.class);
        ChannelPipeline channelPipeline = mock(ChannelPipeline.class);

        // Mock SocketChannel#pipeline() method
        when(socketChannel.pipeline()).thenReturn(channelPipeline);

        // HttpServerInitializer#initChannel(SocketChannel) call real method
        doCallRealMethod().when(httpServerInitializer).initChannel(socketChannel);

        // Start test for HttpServerInitializer#initChannel(SocketChannel)
        httpServerInitializer.initChannel(socketChannel);

        // Verify 4 times calling ChannelPipeline#addLast() method
        verify(channelPipeline, times(4)).addLast(any(ChannelHandler.class));

        // Verify the order of calling ChannelPipeline#addLast() method
        InOrder inOrder = inOrder(channelPipeline);
        inOrder.verify(channelPipeline).addLast(any(HttpRequestDecoder.class));
        inOrder.verify(channelPipeline).addLast(any(HttpObjectAggregator.class));
        inOrder.verify(channelPipeline).addLast(any(HttpResponseEncoder.class));

        inOrder.verify(channelPipeline).addLast(any(HttpServerHandler.class));
    }