code: public static List<Token> getTokenSpan(JCas jCas, Token firstToken, Token lastToken)
      {
          if (firstToken == null) {
              throw new NullPointerException("firstToken is null");
          }
  
          if (lastToken == null) {
              throw new NullPointerException("lastToken is null");
          }
  
          if (firstToken.getBegin() > lastToken.getBegin()) {
              throw new IllegalArgumentException("firstToken (begin: " + firstToken.getBegin()
                      + ") appears after lastToken (begin: " + lastToken.getBegin() + ")");
          }
  
          List<Token> result = new ArrayList<Token>();
  
          for (Token t : JCasUtil.select(getInitialView(jCas), Token.class)) {
              if (t.getBegin() >= firstToken.getBegin() && t.getBegin() <= lastToken.getBegin()) {
                  result.add(t);
              }
          }
  
          return result;
      }
docs: Returns a list of tokens starting with firstToken and ending with lastToken (incl.)
  
  @param jCas       jCas
  @param firstToken first token of the span
  @param lastToken  last token of the span
  @return list (never empty, contains at least one token if firstToken = lastToken)
  @throws IllegalArgumentException if last token precedes first token
  @throws NullPointerException     if firstToken or lastToken are null