public String createRegexForUrlTemplate(String url, String placeholder) {
        String transformedUrl = Arrays.stream(StringUtils.splitByWholeSeparator(url, placeholder))
                .map(part -> StringUtils.isBlank(part) ? part : Pattern.quote(part))
                .collect(Collectors.joining(".*?"));
        return "^" + transformedUrl + "$";
    }
@Test
    public void createRegexForTemplateUrl() {
        String url = "https://example.com/api/lookup?key=message_key&a=b&c=message_key&e=f";
        String template = "https://example.com/api/lookup?key=${key}&a=b&c=${key}&e=f";
        String expected = "^\\Qhttps://example.com/api/lookup?key=\\E.*?\\Q&a=b&c=\\E.*?\\Q&e=f\\E$";
        String got = regexHelper.createRegexForUrlTemplate(template, "${key}");
        assertThat(got).isEqualTo(expected);
        Pattern compiled = Pattern.compile(got, Pattern.DOTALL);
        assertThat(compiled.matcher(url).find()).isTrue();
    }