docs: public static boolean matches(String[] patterns, String value) {
          for (int i = 0; i < patterns.length; i++) {
              String pattern = patterns[i];
              if (pattern.equals(value)) {
                  return true;
              }
              if (pattern.endsWith("*")) {
                  if (value.startsWith(pattern.substring(0, pattern.length() - 1))) {
                      return true;
                  }
              }
              if (pattern.startsWith("*")) {
                  if (value.endsWith(pattern.substring(1))) {
                      return true;
                  }
              }
          }
          return false;
      }