public Future<Void> closeAsync() {
        // Execute close asynchronously in case this is being invoked on an eventloop to avoid blocking
        return GlobalEventExecutor.INSTANCE.submit(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                close();
                return null;
            }
        });
    }
@Test
    public void testCloseAsync() throws Exception {
        final LocalAddress addr = new LocalAddress(getLocalAddrId());
        final EventLoopGroup group = new DefaultEventLoopGroup();

        // Start server
        final ServerBootstrap sb = new ServerBootstrap()
                .group(group)
                .channel(LocalServerChannel.class)
                .childHandler(new ChannelInitializer<LocalChannel>() {
                    @Override
                    protected void initChannel(LocalChannel ch) throws Exception {
                        ch.pipeline().addLast(new ChannelInboundHandlerAdapter());
                    }
                });
        final Channel sc = sb.bind(addr).syncUninterruptibly().channel();

        // Create pool, acquire and return channels
        final Bootstrap bootstrap = new Bootstrap()
                .channel(LocalChannel.class).group(group).remoteAddress(addr);
        final SimpleChannelPool pool = new SimpleChannelPool(bootstrap, new CountingChannelPoolHandler());
        Channel ch1 = pool.acquire().syncUninterruptibly().getNow();
        Channel ch2 = pool.acquire().syncUninterruptibly().getNow();
        pool.release(ch1).get(1, TimeUnit.SECONDS);
        pool.release(ch2).get(1, TimeUnit.SECONDS);

        // Assert that returned channels are open before close
        assertTrue(ch1.isOpen());
        assertTrue(ch2.isOpen());

        // Close asynchronously with timeout
        pool.closeAsync().get(1, TimeUnit.SECONDS);

        // Assert channels were indeed closed
        assertFalse(ch1.isOpen());
        assertFalse(ch2.isOpen());

        sc.close().sync();
        pool.close();
        group.shutdownGracefully();
    }