code: public R getMatch() {
      for (Pattern<T, R> pattern : patterns) {
        if (pattern.matches(value)) {
          return pattern.apply(value);
        }
      }
  
      throw new MatchException("No match found for " + value);
    }
docs: Runs through the possible matches and executes the specified action of the first match and
  returns the result.
  
  @throws MatchException if no match is found.