code: @Override
    public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
      long endTimeNanos = System.nanoTime() + unit.toNanos(timeout);
      for (ManagedChannel channel : channels) {
        if (channel.isTerminated()) {
          continue;
        }
        long awaitTimeNanos = endTimeNanos - System.nanoTime();
        if (awaitTimeNanos <= 0) {
          break;
        }
        channel.awaitTermination(awaitTimeNanos, TimeUnit.NANOSECONDS);
      }
  
      return isTerminated();
    }
docs: {@inheritDoc}