docs: public static boolean keyMatch(String key1, String key2) {
          int i = key2.indexOf('*');
          if (i == -1) {
              return key1.equals(key2);
          }
  
          if (key1.length() > i) {
              return key1.substring(0, i).equals(key2.substring(0, i));
          }
          return key1.equals(key2.substring(0, i));
      }