code: public static InetSocketAddress getInetSocketAddress(String endpoint) {
      String[] array = endpoint.split(":");
      return new InetSocketAddress(array[0], Integer.parseInt(array[1]));
    }
docs: Convert an endpoint from String (host:port) to InetSocketAddress
  
  @param endpoint a String in (host:port) format
  @return an InetSocketAddress representing the endpoint