docs: private static Pattern globToRegexp(String glob) {
          final Pattern globToRegexpPattern = Pattern.compile("(\\*\\*)|(\\*)");
          final Matcher matcher = globToRegexpPattern.matcher(glob);
          final StringBuffer sb = new StringBuffer();
          int lastEnd = 0;
          while (matcher.find()) {
              sb.append(Pattern.quote(glob.substring(lastEnd, matcher.start())));
              if (matcher.group(1) != null) {
                  sb.append(Matcher.quoteReplacement(".*"));
              }
              if (matcher.group(2) != null) {
                  sb.append(Matcher.quoteReplacement("[^.$]*"));
              }
              lastEnd = matcher.end();
          }
          sb.append(Pattern.quote(glob.substring(lastEnd, glob.length())));
          return Pattern.compile(sb.toString());
      }