@Override
    public Token LT(int k) {
        //System.out.println("enter LT("+k+")");
        lazyInit();
        if ( k == 0 ) return null;
        if ( k < 0 ) return LB(-k);
        int i = p;
        int n = 1; // we know tokens[p] is a good one
        // find k good tokens
        while ( n<k ) {
            // skip off-channel tokens, but make sure to not look past EOF
			if (sync(i + 1)) {
				i = nextTokenOnChannel(i + 1, channel);
			}
            n++;
        }
//		if ( i>range ) range = i;
        return tokens.get(i);
    }
Constructs a new {@link CommonTokenStream} using the specified token
source and filtering tokens to the specified channel. Only tokens whose
{@link Token#getChannel} matches {@code channel} or have the
{@link Token#getType} equal to {@link Token#EOF} will be returned by the
token stream lookahead methods.

@param tokenSource The token source.
@param channel The channel to use for filtering tokens.
runtime/Java/src/org/antlr/v4/runtime/CommonTokenStream.java