docs: private static boolean matchWildCards(String name, String template) {
          int wildcardIndex = template.indexOf("*");
          if (wildcardIndex == -1) {
              return name.equals(template);
          }
  
          boolean isBeginning = true;
          String beforeWildcard;
          String afterWildcard = template;
          while (wildcardIndex != -1) {
              beforeWildcard = afterWildcard.substring(0, wildcardIndex);
              afterWildcard = afterWildcard.substring(wildcardIndex + 1);
  
              int beforeStartIndex = name.indexOf(beforeWildcard);
              if ((beforeStartIndex == -1) || (isBeginning && beforeStartIndex != 0)) {
                  return false;
              }
              isBeginning = false;
  
              name = name.substring(beforeStartIndex + beforeWildcard.length());
              wildcardIndex = afterWildcard.indexOf("*");
          }
  
          return name.endsWith(afterWildcard);
      }