code: public static TransportAddress[] fromHostAndPorts(final List<HostAndPort> hostAndPorts) {
          if (hostAndPorts == null) {
              return new TransportAddress[0];
          } else {
              TransportAddress[] transportAddresses = new TransportAddress[hostAndPorts.size()];
  
              for (int i = 0; i < hostAndPorts.size(); i++) {
                  transportAddresses[i] = fromHostAndPort(hostAndPorts.get(i));
              }
  
              return transportAddresses;
          }
      }
docs: Convert a list of {@link HostAndPort} instances to an array of {@link TransportAddress} instances.
  
  @param hostAndPorts a {@link List} of valid {@link HostAndPort} instances
  @return an array of {@link TransportAddress} instances
  @see #fromHostAndPort(com.google.common.net.HostAndPort)