public List<Integer> findMatchingPatterns() {
        List<Integer> patternList = new ArrayList<Integer>();
        int count = 0;
        while (this.text.length() > 0) {
            Tree.Node<String, Integer> parent = trie.getRoot();
            for (int i = 0; i < text.length(); i++) {
                if (isPatternPresent(parent, 0)) {
                    patternList.add(count);
                }
                this.text = this.text.substring(1);
                this.recursive = true;
                count++;
            }
        }

        for (Integer i : patternList) {
            System.out.print(i + " ");
        }
        return patternList;
    }