code: public static List<String[]> parseHosts(String hostsStr, String defaultPort) {
          List<String[]> parsedHosts;
          if(hostsStr!=null && hostsStr.length()>0) {
              String[] hosts = hostsStr.split(",");
              parsedHosts = new ArrayList<>(hosts.length);
              for(String host: hosts) {
                  int portSep = host.indexOf(':');
                  if(portSep>-1) {
                          String hostName = host.substring(0,portSep);
                          String port = host.substring(portSep+1);
                          log.debug("adding E.S. host Addresss: {}:{}", hostName,port);
                          parsedHosts.add(new String[]{hostName,port});
                  } else {
                      log.debug("adding E.S. host Addresss, with default port: {}:{}", host,defaultPort);
                      parsedHosts.add(new String[]{host,defaultPort});
                  }
              }
              return parsedHosts;
          } else {
              return Collections.EMPTY_LIST;
          }
      }
docs: Given a string in the format host[:port],host[:port].  The string is split on comma (,),
  returning a list of String[].  The String[] is a two element array containing:
  <ul>
  <li>String[0] : hostname</li>
  <li>String[1] : portnumber</li>
  </ul>
  
  The port element is optional, i.e. host,host,host.  In this case the defaultPort is used.
  
  @param hostsStr The string to parse and obtain the host names
  @param defaultPort The default port if one is not specified.
  @return