code: public static String buildHostsOnlyList(List<HostAndPort> hostAndPorts) {
      StringBuilder sb = new StringBuilder();
      for (HostAndPort hostAndPort : hostAndPorts) {
        sb.append(hostAndPort.getHostText()).append(",");
      }
      if (sb.length() > 0) {
        sb.delete(sb.length() - 1, sb.length());
      }
      return sb.toString();
    }
docs: Build up to a hosts only list
  @param hostAndPorts
  @return a list of the hosts only