public static Optional<String> getValidLogUrlPattern(
            final Configuration config, final ConfigOption<String> option) {
        String pattern = config.get(option);
        if (StringUtils.isNullOrWhitespaceOnly(pattern)) {
            return Optional.empty();
        }

        pattern = pattern.trim();

        String scheme = pattern.substring(0, Math.max(pattern.indexOf(SCHEME_SEPARATOR), 0));
        if (scheme.isEmpty()) {
            return Optional.of(HTTP_SCHEME + SCHEME_SEPARATOR + pattern);
        } else if (HTTP_SCHEME.equalsIgnoreCase(scheme) || HTTPS_SCHEME.equalsIgnoreCase(scheme)) {
            return Optional.of(pattern);
        } else {
            LOG.warn(
                    "Ignore configured value for '{}': unsupported scheme {}",
                    option.key(),
                    scheme);
            return Optional.empty();
        }
    }
@Test
    void testGetValidLogUrlPatternNotConfigured() {
        Configuration config = new Configuration();
        assertThat(
                        LogUrlUtil.getValidLogUrlPattern(
                                config, HISTORY_SERVER_JOBMANAGER_LOG_URL_PATTERN))
                .isNotPresent();
        assertThat(
                        LogUrlUtil.getValidLogUrlPattern(
                                config, HISTORY_SERVER_TASKMANAGER_LOG_URL_PATTERN))
                .isNotPresent();
    }