/// <summary>
        /// Given a sequence, applies our patterns over the sequence and returns
        /// all matches, depending on the findType.
        /// </summary>
        /// <remarks>
        /// Given a sequence, applies our patterns over the sequence and returns
        /// all matches, depending on the findType.  When multiple patterns overlaps,
        /// matched patterns are selected by order specified by the comparator
        /// </remarks>
        /// <param name="elements">input sequence to match against</param>
        /// <param name="findType">whether FindType.FIND_ALL or FindType.FIND_NONOVERLAPPING</param>
        /// <returns>list of match results</returns>
        public virtual IList <ISequenceMatchResult <T> > Find <_T0>(IList <_T0> elements, SequenceMatcher.FindType findType)
            where _T0 : T
        {
            ICollection <SequencePattern <T> > triggered = GetTriggeredPatterns(elements);
            IList <ISequenceMatchResult <T> >  all       = new List <ISequenceMatchResult <T> >();
            int i = 0;

            foreach (SequencePattern <T> p in triggered)
            {
                if (Thread.Interrupted())
                {
                    // Allow interrupting
                    throw new RuntimeInterruptedException();
                }
                SequenceMatcher <T> m = p.GetMatcher(elements);
                m.SetMatchWithResult(matchWithResult);
                m.SetFindType(findType);
                m.SetOrder(i);
                while (m.Find())
                {
                    all.Add(m.ToBasicSequenceMatchResult());
                }
                i++;
            }
            IList <ISequenceMatchResult <T> > res = IntervalTree.GetNonOverlapping(all, SequenceMatchResultConstants.ToInterval, SequenceMatchResultConstants.DefaultComparator);

            res.Sort(SequenceMatchResultConstants.OffsetComparator);
            return(res);
        }