private static ConditionEvaluationResult enableIfOpen(final EnabledIfListeningOnPort annotation, final AnnotatedElement element) {
        val ports = annotation.port();
        if (ports.length == 0) {
            throw new IllegalArgumentException("At least one port must be defined");
        }
        if (ignorePortCheck()) {
            return ConditionEvaluationResult.enabled(
                String.format("%s is enabled because %s environment variable is set", element, IGNORE_PORT_CHECK));
        }
        for (val port : ports) {
            if (port > 0 && SocketUtils.isTcpPortAvailable(port)) {
                return ConditionEvaluationResult.disabled(String.format("%s is disabled because %s is not listening for requests", element, port));
            }
        }
        return ConditionEvaluationResult.enabled(
            String.format("%s is enabled because all ports (%s) is open.", element, Arrays.toString(ports)));
    }
This is {@link EnabledIfPortOpenCondition}.

@author Timur Duehr
@since 6.1.0
core/cas-server-core-util-api/src/test/java/org/apereo/cas/util/junit/EnabledIfPortOpenCondition.java