code: protected List<HostAddress> populateHostAddresses() {
          List<HostAddress> failedAddresses = new LinkedList<>();
          if (config.hostAddress != null) {
              hostAddresses = new ArrayList<>(1);
              HostAddress hostAddress = new HostAddress(config.port, config.hostAddress);
              hostAddresses.add(hostAddress);
          }
          else if (config.host != null) {
              hostAddresses = new ArrayList<>(1);
              HostAddress hostAddress = DNSUtil.getDNSResolver().lookupHostAddress(config.host, config.port, failedAddresses, config.getDnssecMode());
              if (hostAddress != null) {
                  hostAddresses.add(hostAddress);
              }
          } else {
              // N.B.: Important to use config.serviceName and not AbstractXMPPConnection.serviceName
              DnsName dnsName = DnsName.from(config.getXMPPServiceDomain());
              hostAddresses = DNSUtil.resolveXMPPServiceDomain(dnsName, failedAddresses, config.getDnssecMode());
          }
          // Either the populated host addresses are not empty *or* there must be at least one failed address.
          assert (!hostAddresses.isEmpty() || !failedAddresses.isEmpty());
          return failedAddresses;
      }
docs: Populates {@link #hostAddresses} with the resolved addresses or with the configured host address. If no host
  address was configured and all lookups failed, for example with NX_DOMAIN, then {@link #hostAddresses} will be
  populated with the empty list.
  
  @return a list of host addresses where DNS (SRV) RR resolution failed.