class HibernateSimpleQueryUtils {

    static String replaceTermWithFuzzyAndPrefixDisjunction(Pair<Integer, Integer> startEndIndexPair, String simpleQuery) {
        var termStartIndex = startEndIndexPair.getFirst();
        var termEndIndex = startEndIndexPair.getSecond();

        var term = simpleQuery.substring(termStartIndex, termEndIndex + 1);
        var replaceTerm = String.format("(%s)",
                createLuceneQueryString(List.of(term, term + "~1", term + "*"), "|"));

        return replaceSubstring(startEndIndexPair, simpleQuery, replaceTerm);
    }

}