public static List<HostAndPort> parseHosts(String envHosts,
	    List<HostAndPort> existingHostsAndPorts) {

	if (null != envHosts && 0 < envHosts.length()) {

	    String[] hostDefs = envHosts.split(",");

	    if (null != hostDefs && 2 <= hostDefs.length) {

		List<HostAndPort> envHostsAndPorts = new ArrayList<HostAndPort>(
			hostDefs.length);

		for (String hostDef : hostDefs) {

		    String[] hostAndPort = hostDef.split(":");

		    if (null != hostAndPort && 2 == hostAndPort.length) {
			String host = hostAndPort[0];
			int port = Protocol.DEFAULT_PORT;

			try {
			    port = Integer.parseInt(hostAndPort[1]);
			} catch (final NumberFormatException nfe) {
			}

			envHostsAndPorts.add(new HostAndPort(host, port));
		    }
		}

		return envHostsAndPorts;
	    }
	}

	return existingHostsAndPorts;
    }