private static boolean tryFindSentence(final Map<Integer, Set<String>> words, final int[] indexes, int startIndOfCurrWord, int currWordNumberInOrder, final int phoneLength) {
        Set<String> wordsByIndex = words.get(startIndOfCurrWord);
        if (startIndOfCurrWord >= phoneLength || wordsByIndex == null || wordsByIndex.isEmpty())
            return false;
        indexes[currWordNumberInOrder] = startIndOfCurrWord;
        for (String word : wordsByIndex) {
            if (word.length() == phoneLength - startIndOfCurrWord) { //we've found the last word in the sentence
                for (int i = currWordNumberInOrder + 1; i < indexes.length; i++)
                    indexes[i] = -1;
                return true;
            }
            boolean findSentence = tryFindSentence(words, indexes, startIndOfCurrWord + word.length(), currWordNumberInOrder + 1, phoneLength);
            if (findSentence) return true;
        }
        return false;
    }