code: public void doMatch() {
      boolean matchFound = false;
      for (ConsumablePattern<T> pattern : patterns) {
        if (pattern.matches(value)) {
          pattern.consume(value);
          matchFound = true;
          break;
        }
      }
  
      if (!matchFound) {
        throw new MatchException("No match found for " + value);
      }
    }
docs: Runs through the possible matches and executes the specified consumer of the first match.
  
  @throws MatchException if no match is found.