docs: public String extractPathWithinPattern(String pattern, String path) {
          String[] patternParts = tokenize(pattern);
          String[] pathParts = tokenize(path);
  
          StringBuilder builder = new StringBuilder();
  
          // Add any path parts that have a wildcarded pattern part.
          int puts = 0;
          for (int i = 0; i < patternParts.length; i++) {
              String patternPart = patternParts[i];
              if ((patternPart.indexOf('*') > -1 || patternPart.indexOf('?') > -1) && pathParts.length >= i + 1) {
                  if (puts > 0 || (i == 0 && !pattern.startsWith(pathSeparator))) {
                      builder.append(pathSeparator);
                  }
                  builder.append(pathParts[i]);
                  puts++;
              }
          }
  
          // Append any trailing path parts.
          for (int i = patternParts.length; i < pathParts.length; i++) {
              if (puts > 0 || i > 0) {
                  builder.append(pathSeparator);
              }
              builder.append(pathParts[i]);
          }
  
          return builder.toString();
      }