void (@NotNull Channel serverChannel, @NotNull CountDownLatch countDown, @NotNull GenericFutureListener<ChannelFuture> listener) { ChannelFuture close = serverChannel.close(); if (close.isDone()) { countDown.countDown(); } else { close.addListener(listener); } }