public static String convertLikePatternToRegex(final String pattern) {
        String result = pattern;
        if (pattern.contains("_")) {
            result = SINGLE_CHARACTER_PATTERN.matcher(result).replaceAll("$1.");
            result = SINGLE_CHARACTER_ESCAPE_PATTERN.matcher(result).replaceAll("_");
        }
        if (pattern.contains("%")) {
            result = ANY_CHARACTER_PATTERN.matcher(result).replaceAll("$1.*");
            result = ANY_CHARACTER_ESCAPE_PATTERN.matcher(result).replaceAll("%");
        }
        return result;
    }
@Test
    void assertConvertLikePatternToRegexWhenContainsPattern() {
        assertThat(RegexUtils.convertLikePatternToRegex("sharding_db"), is("sharding.db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding%db"), is("sharding.*db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding%_db"), is("sharding.*.db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding\\_db"), is("sharding_db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding\\%db"), is("sharding%db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding\\%\\_db"), is("sharding%_db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding_\\_db"), is("sharding._db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding%\\%db"), is("sharding.*%db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding_\\%db"), is("sharding.%db"));
        assertThat(RegexUtils.convertLikePatternToRegex("sharding\\_%db"), is("sharding_.*db"));
    }