private static String checkAndConvertToCompatibleIPv6Syntax(String hostAddress) {
    // if host string contains ":", considering it as an IPv6 Address
    // Conforming to RFC2732 - http://www.ietf.org/rfc/rfc2732.txt
    if (hostAddress.contains(":")) {
      logger.debug("IPv6 host address detected, using IPv6 syntax for host in JMX connection URL");
      hostAddress = "[" + hostAddress + "]";
      logger.debug("Compatible host address is : " + hostAddress);
    }
    return hostAddress;
  }
If the given host address contains a ":", considers it as an IPv6 address & returns the host
based on RFC2732 requirements i.e. surrounds the given host address string with square
brackets. If ":" is not found in the given string, simply returns the same string.

@param hostAddress host address to check if it's an IPv6 address

@return for an IPv6 address returns compatible host address otherwise returns the same string
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/shell/JmxOperationInvoker.java