code: public Routed<T> route(String path) {
      final String[]            tokens  = Pattern.removeSlashAtBothEnds(path).split("/");
      final Map<String, String> params  = new HashMap<String, String>();
      boolean                   matched = true;
  
      for (final Pattern<T> pattern : patterns) {
        final String[] currTokens = pattern.tokens();
        final T        target     = pattern.target();
  
        matched = true;
        params.clear();
  
        if (tokens.length == currTokens.length) {
          for (int i = 0; i < currTokens.length; i++) {
            final String token     = tokens[i];
            final String currToken = currTokens[i];
  
            if (currToken.length() > 0 && currToken.charAt(0) == ':') {
              params.put(currToken.substring(1), token);
            } else if (!currToken.equals(token)) {
              matched = false;
              break;
            }
          }
        } else if (currTokens.length > 0 && currTokens[currTokens.length - 1].equals(":*") && tokens.length >= currTokens.length) {
          for (int i = 0; i < currTokens.length - 1; i++) {
            final String token     = tokens[i];
            final String currToken = currTokens[i];
  
            if (currToken.length() > 0 && currToken.charAt(0) == ':') {
              params.put(currToken.substring(1), token);
            } else if (!token.equals(token)) {
              matched = false;
              break;
            }
          }
  
          if (matched) {
            final StringBuilder b = new StringBuilder(tokens[currTokens.length - 1]);
            for (int i = currTokens.length; i < tokens.length; i++) {
              b.append('/');
              b.append(tokens[i]);
            }
            params.put("*", b.toString());
          }
        } else {
          matched = false;
        }
  
        if (matched) return new Routed<T>(target, false, params);
      }
  
      if (notFound != null) {
        params.clear();
        return new Routed<T>(notFound, true, params);
      }
  
      return null;
    }
docs: ----------------------------------------------------------------------------