class HibernateSimpleQueryUtils {

    static int getIndexOfFirstAppearanceOfAny(int startIndex, Set<Character> characters, String searchedString) {
        var queryCharCount = searchedString.length();

        if(startIndex >= queryCharCount) {
            return -1;
        }

        for(var currentIndex = startIndex; currentIndex < queryCharCount; currentIndex++) {
            if(characters.contains(searchedString.charAt(currentIndex))) {
                return currentIndex;
            }
        }

        return -1;
    }

}