protected boolean sync(int i) {
		assert i >= 0;
        int n = i - tokens.size() + 1; // how many more elements we need?
        //System.out.println("sync("+i+") needs "+n);
        if ( n > 0 ) {
			int fetched = fetch(n);
			return fetched >= n;
		}

		return true;
    }
Make sure index {@code i} in tokens has a token.

@return {@code true} if a token is located at index {@code i}, otherwise
   {@code false}.
@see #get(int i)
runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java