code: public <T extends ElementType<E>> E consume(T... expected) {
          E lookahead = lookahead(1);
          for (ElementType<E> type : expected) {
              if (type.isMatchedBy(lookahead)) {
                  return consume();
              }
          }
          throw new UnexpectedElementException(lookahead, offset, expected);
      }
docs: Consumes the next element in this stream
  only if it is of the expected types.
  
  @param <T> represents the element type of this stream, removes the
  "unchecked generic array creation for varargs parameter"
  warnings
  @param expected the types which are expected
  @return the next element in this stream
  @throws UnexpectedElementException if the next element is of an unexpected type