code: protected List<InetSocketAddress> getAddresses(final String s) {
          if (s == null) {
              throw new NullPointerException("Null host list");
          }
          if (s.trim().isEmpty()) {
              throw new IllegalArgumentException("No hosts in list: '" + s + "'");
          }
  
          List<InetSocketAddress> addrs = new ArrayList<InetSocketAddress>();
          for (String hoststuff : s.split("(?:\\s|,)+")) {
              if ("".equals(hoststuff)) {
                  continue;
              }
  
              int finalColon = hoststuff.lastIndexOf(':');
              if (finalColon < 1) {
                  throw new IllegalArgumentException("Invalid server '" + hoststuff + "' in list:  " + s);
  
              }
              String hostPart = hoststuff.substring(0, finalColon);
              String portNum = hoststuff.substring(finalColon + 1);
  
              addrs.add(new InetSocketAddress(hostPart, Integer.parseInt(portNum)));
          }
          return addrs;
      }
docs: Split a string containing whitespace or comma separated host or IP addresses and port numbers of the form
  "host:port host2:port" or "host:port, host2:port" into a List of InetSocketAddress instances suitable for
  instantiating a MemcachedClient.
  
  Note that colon-delimited IPv6 is also supported. For example: ::1:11211