code: @Override
      public final void unbind(Iterable<? extends SocketAddress> localAddresses) {
          if (localAddresses == null) {
              throw new NullPointerException("localAddresses");
          }
  
          boolean deactivate = false;
          synchronized (bindLock) {
              if (boundAddresses.isEmpty()) {
                  return;
              }
  
              List<SocketAddress> localAddressesCopy = new ArrayList<>();
              int specifiedAddressCount = 0;
              for (SocketAddress a: localAddresses) {
                  specifiedAddressCount ++;
                  if (a != null && boundAddresses.contains(a)) {
                      localAddressesCopy.add(a);
                  }
              }
              if (specifiedAddressCount == 0) {
                  throw new IllegalArgumentException("localAddresses is empty.");
              }
  
              if (!localAddressesCopy.isEmpty()) {
                  try {
                      unbind0(localAddressesCopy);
                  } catch (RuntimeException e) {
                      throw e;
                  } catch (Throwable e) {
                      throw new RuntimeIoException(
                              "Failed to unbind from: " + getLocalAddresses(), e);
                  }
  
                  boundAddresses.removeAll(localAddressesCopy);
                  if (boundAddresses.isEmpty()) {
                      deactivate = true;
                  }
              }
              if (deactivate) {
                  getListeners().fireServiceDeactivated();
              }
          }
      }
docs: {@inheritDoc}