public List<Integer> matches(List<E> text){
  List<Integer> matchPositions=new ArrayList<>();
  int j=0;
  int n=text.size();
  int m=pattern.size();
  while (j <= n - m) {
    E c=text.get(j + m - 1);
    if (doItemsMatch(pattern.get(m - 1),c)) {
      if (doesTextSpanMatch(text,j))       matchPositions.add(j);
    }
    j+=getBadCharSkip(c);
  }
  return matchPositions;
}

public List < Integer > matches ( List < E > text ) { List < Integer > matchPositions = new ArrayList < > ( ) ; int j = 0 ; int n = text . size ( ) ; int m = pattern . size ( ) ; while ( j <= n - m ) { E c = text . get ( j + m - 1 ) ; if ( doItemsMatch ( pattern . get ( m - 1 ) , c ) ) { if ( doesTextSpanMatch ( text , j ) ) matchPositions . add ( j ) ; } j += getBadCharSkip ( c ) ; } return matchPositions ; }
get a list of positions pointing into the input where the pattern matches .
