public static String formatAddress(String host, Integer port) {
        return host.contains(":")
                ? "[" + host + "]:" + port // IPv6
                : host + ":" + port;
    }
Formats hostname and port number as a "host:port" address string,
surrounding IPv6 addresses with braces '[', ']'
@param host hostname
@param port port number
@return address string
clients/src/main/java/org/apache/kafka/common/utils/Utils.java