private static String applyRFC2732(String hostname) {
    if (hostname.indexOf(":") != -1) {
      // Assuming an IPv6 literal because of the ':'
      return "[" + hostname + "]";
    }
    return hostname;
  }
Process the String form of a hostname to make it comply with Jmx URL restrictions. Namely wrap
IPv6 literal address with "[", "]"

@param hostname the name to safeguard.
@return a string representation suitable for use in a Jmx connection URL
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java