docs: public static HostAndPort parseCompat(String hostAndPortPart) {
  
          int firstColonIndex = hostAndPortPart.indexOf(':');
          int lastColonIndex = hostAndPortPart.lastIndexOf(':');
          int bracketIndex = hostAndPortPart.lastIndexOf(']');
  
          if (firstColonIndex != lastColonIndex && lastColonIndex != -1 && bracketIndex == -1) {
  
              String hostPart = hostAndPortPart.substring(0, lastColonIndex);
              String portPart = hostAndPortPart.substring(lastColonIndex + 1);
  
              return HostAndPort.of(hostPart, Integer.parseInt(portPart));
          }
  
          return HostAndPort.parse(hostAndPortPart);
      }