public static boolean hasWildcard(String path) {
        for (int i = 0; i < path.length(); i++) {
            char ch = path.charAt(i);
            // check if the current char is wildcard AND if it isn't escaped by backslash
            if (WILDCARDS.contains(ch) && !(i > 0 && path.charAt(i - 1) == BACKSLASH)) {
                return true;
            }
        }
        return false;
    }
@Test
    public void shouldDetectWildcard() {
        assertThat(hasWildcard("/path/to/file/*")).isTrue();
        assertThat(hasWildcard("/path/to/file/?")).isTrue();
        assertThat(hasWildcard("/path/to/file/{abc}")).isTrue();
        assertThat(hasWildcard("/path/to/file/[abc]")).isTrue();
        assertThat(hasWildcard("*")).isTrue();

        assertThat(hasWildcard("/path/*/file/*")).isTrue();
        assertThat(hasWildcard("/path/\\*/file/*")).isTrue();
        assertThat(hasWildcard("/path/*/file/\\*")).isTrue();

        assertThat(hasWildcard("/path/to/file/\\*")).isFalse();
        assertThat(hasWildcard("\\*")).isFalse();
        assertThat(hasWildcard("/path/\\*/file/\\*")).isFalse();
    }