code: @Override
      public final void bind(Iterable<? extends SocketAddress> localAddresses) throws IOException {
          if (isDisposing()) {
              throw new IllegalStateException("Already disposed.");
          }
  
          if (localAddresses == null) {
              throw new NullPointerException("localAddresses");
          }
  
          List<SocketAddress> localAddressesCopy = new ArrayList<>();
  
          for (SocketAddress a: localAddresses) {
              checkAddressType(a);
              localAddressesCopy.add(a);
          }
  
          if (localAddressesCopy.isEmpty()) {
              throw new IllegalArgumentException("localAddresses is empty.");
          }
  
          boolean activate = false;
          synchronized (bindLock) {
              if (boundAddresses.isEmpty()) {
                  activate = true;
              }
  
              if (getHandler() == null) {
                  throw new IllegalStateException("handler is not set.");
              }
  
              try {
                  boundAddresses.addAll(bindInternal(localAddressesCopy));
              } catch (IOException | RuntimeException e) {
                  throw e;
              } catch (Throwable e) {
                  throw new RuntimeIoException(
                          "Failed to bind to: " + getLocalAddresses(), e);
              }
              if (activate) {
                  getListeners().fireServiceActivated();
              }
          }
  
      }
docs: {@inheritDoc}