class InetSocketAddressFactory {

  public InetSocketAddress newInstance(String host) {
    int index = host.indexOf(':');
    if (index == -1) {
      throw new IllegalArgumentException("No port found in host:" + host);
    }
    String hostname = host.substring(0, index);
    int port = Integer.parseInt(host.substring(index + 1));
    return new InetSocketAddress(hostname, port);
  }

}