code: @SuppressWarnings("unchecked")
      public <T extends ElementType> boolean positiveLookaheadBefore(
          ElementType before,
          T... expected
      ) {
          Character lookahead;
          for (int i = 1; i <= elements.length; i++) {
              lookahead = lookahead(i);
              if (before.isMatchedBy(lookahead)) {
                  break;
              }
              for (ElementType type : expected) {
                  if (type.isMatchedBy(lookahead)) {
                      return true;
                  }
              }
          }
          return false;
      }
docs: Checks if there exists an element in this stream of
  the expected types before the specified type.
  
  @param <T> represents the element type of this stream, removes the
  "unchecked generic array creation for varargs parameter"
  warnings
  @param before the type before which to search
  @param expected the expected types
  @return {@code true} if there is an element of the expected types
  before the specified type or {@code false} otherwise