code: public ParserToken consume(@NonNull ParserTokenType expectedType) throws ParseException {
        ParserToken next = consume();
        if (next == null || !expectedType.isInstance(next.type)) {
           throw new ParseException("Expected the next token to be of type " + expectedType + ", but found " + (next == null
                                                                                                                ? null
                                                                                                                : next.type));
        }
        return next;
     }
docs: Consumes the next token and ensures it is of a given type
  
  @param expectedType The expected token type
  @return The next token
  @throws ParseException The next token is not of the expected type