Code review comment: Before doing all this computation, should we first check if logging at `info` level is enabled?

Code under review:
static void validateNettyVersions(Consumer<String> logger) {
        Map<String, String> pomVersions = CoreUtils.getProperties(PROPERTIES_FILE_NAME);
        String nettyVersion = pomVersions.get(NETTY_VERSION_PROPERTY);
        String nettyTcnativeVersion = pomVersions.get(NETTY_TCNATIVE_VERSION_PROPERTY);

        Map<String, Version> nettyVersions = Version.identify();
        List<String> versionInformation = new ArrayList<>(11); 

        Set<String> nonNativeNettyVersions = new HashSet<>();
        for (String artifact : REQUIRED_NETTY_VERSION_ARTIFACTS) {
            Version version = nettyVersions.get(artifact);

            
            
            if (version == null) {
                versionInformation.add("'io.netty:" + artifact + "' (not found and is required)");
                nonNativeNettyVersions.add("unknown");
            } else {
                versionInformation.add("'io.netty:" + artifact + "' version: " + version.artifactVersion());
                nonNativeNettyVersions.add(version.artifactVersion());
            }
        }

        for (String artifact : OPTIONAL_NETTY_VERSION_ARTIFACTS) {
            Version version = nettyVersions.get(artifact);

            
            
            if (version != null) {
                versionInformation.add("'io.netty:" + artifact + "' version: " + version.artifactVersion());
                nonNativeNettyVersions.add(version.artifactVersion());
            }
        }

        for (String artifact : NETTY_TCNATIVE_VERSION_ARTIFACTS) {
            Version version = nettyVersions.get(artifact);

            
            
            if (version != null) {
                versionInformation.add("'io.netty:" + artifact + "' version: " + version.artifactVersion());
            }
        }

        String versionInformationString = CoreUtils.stringJoin(", ", versionInformation);
        StringBuilder stringBuilder
            = new StringBuilder().append("The following is Netty version information that was found on the classpath: ")
                .append(versionInformationString)
                .append(". ");

        if (nonNativeNettyVersions.size() > 1) {
            stringBuilder.append(NETTY_VERSION_MISMATCH_LOG);
        }

        stringBuilder.append("The version of azure-core-http-netty being used was built with Netty version ")
            .append(nettyVersion)
            .append(" and Netty Tcnative version ")
            .append(nettyTcnativeVersion)
            .append(". If your application runs without issue this message can be ignored, otherwise please align the "
                + "Netty versions used in your application. For more information, see "
                + "https:

        logger.accept(stringBuilder.toString());
    }

Line commented on: versionInformation.add("'io.netty:" + artifact + "' (not found and is required)");

Revised code:
static void validateNettyVersions(Consumer<String> logger) {
        Map<String, String> pomVersions = CoreUtils.getProperties(PROPERTIES_FILE_NAME);
        String nettyVersion = pomVersions.get(NETTY_VERSION_PROPERTY);
        String nettyTcnativeVersion = pomVersions.get(NETTY_TCNATIVE_VERSION_PROPERTY);

        Map<String, Version> nettyVersions = Version.identify();
        List<String> versionInformation = new ArrayList<>(11); 

        Set<String> nonNativeNettyVersions = new HashSet<>();
        for (String artifact : REQUIRED_NETTY_VERSION_ARTIFACTS) {
            Version version = nettyVersions.get(artifact);

            
            
            if (version == null) {
                versionInformation.add("'io.netty:" + artifact + "' (not found and is required)");
                nonNativeNettyVersions.add("unknown");
            } else {
                versionInformation.add("'io.netty:" + artifact + "' version: " + version.artifactVersion());
                nonNativeNettyVersions.add(version.artifactVersion());
            }
        }

        for (String artifact : OPTIONAL_NETTY_VERSION_ARTIFACTS) {
            Version version = nettyVersions.get(artifact);

            
            
            if (version != null) {
                versionInformation.add("'io.netty:" + artifact + "' version: " + version.artifactVersion());
                nonNativeNettyVersions.add(version.artifactVersion());
            }
        }

        for (String artifact : NETTY_TCNATIVE_VERSION_ARTIFACTS) {
            Version version = nettyVersions.get(artifact);

            
            
            if (version != null) {
                versionInformation.add("'io.netty:" + artifact + "' version: " + version.artifactVersion());
            }
        }

        String versionInformationString = CoreUtils.stringJoin(", ", versionInformation);
        StringBuilder stringBuilder
            = new StringBuilder().append("The following is Netty version information that was found on the classpath: ")
                .append(versionInformationString)
                .append(". ");

        if (nonNativeNettyVersions.size() > 1) {
            stringBuilder.append(NETTY_VERSION_MISMATCH_LOG);
        }

        stringBuilder.append("The version of azure-core-http-netty being used was built with Netty version ")
            .append(nettyVersion)
            .append(" and Netty Tcnative version ")
            .append(nettyTcnativeVersion)
            .append(". If your application runs without issue this message can be ignored, otherwise please align the "
                + "Netty versions used in your application. For more information, see "
                + "https:

        logger.accept(stringBuilder.toString());
    }