code: public static String asString(SocketAddress socketAddress) {
          final InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress;
          final InetAddress inetAddress = inetSocketAddress.getAddress();
          String host = inetSocketAddress.getHostName();
          if (inetAddress != null) {
              host = inetAddress.getHostAddress();
          }
          return host + ":" + inetSocketAddress.getPort();
      }
docs: Returns a string representation of the specified socket address
  in the form <IPADDRESS>:<PORT>
  
  @param socketAddress the socket address