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