public static List<Token> getPrecedingTokens(JCas jCas, Token token)
    {
        List<Token> result = new ArrayList<Token>();

        for (Token t : JCasUtil.select(getInitialView(jCas), Token.class)) {
            if (t.getBegin() < token.getBegin()) {
                result.add(t);
            }
        }

        return result;
    }
public static List < Token > getPrecedingTokens ( JCas jCas , Token token ) { List < Token > result = new ArrayList < Token > ( ) ; for ( Token t : JCasUtil . select ( getInitialView ( jCas ) , Token . class ) ) { if ( t . getBegin ( ) < token . getBegin ( ) ) { result . add ( t ) ; } } return result ; }
Returns a list of tokens preceding the given token

@param jCas  jCas
@param token token
@return list of tokens (may be empty if the token is the first one, but never null)