docs: @SuppressWarnings("checkstyle:npathcomplexity")
      public static JsonPattern createPattern(NavigableJsonInputAdapter input, JsonSchemaNode schemaNode, JsonPathCursor path) {
          if (schemaNode.isTerminal()) {
              return null;
          }
          JsonPattern pattern = new JsonPattern();
          while (path.getNext() != null) {
              if (schemaNode.isTerminal()) {
                  return null;
              }
              int suggestedIndexInPath;
              int numberOfChildren = ((JsonSchemaStructNode) schemaNode).getChildCount();
              if (path.isArray()) {
                  if (path.isAny()) {
                      pattern.addAny();
                      return pattern;
                  }
                  suggestedIndexInPath = path.getArrayIndex();
              } else {
                  for (suggestedIndexInPath = 0; suggestedIndexInPath < numberOfChildren; suggestedIndexInPath++) {
                      JsonSchemaNameValue nameValue = ((JsonSchemaStructNode) schemaNode)
                              .getChild(suggestedIndexInPath);
                      int nameAddress = nameValue.getNameStart();
                      if (nameAddress < 0) {
                          return null;
                      }
                      input.position(nameAddress);
                      if (input.isAttributeName(path)) {
                          break;
                      }
                  }
              }
              if (isValidIndex(suggestedIndexInPath, (JsonSchemaStructNode) schemaNode, path.isArray())) {
                  schemaNode = ((JsonSchemaStructNode) schemaNode).getChild(suggestedIndexInPath).getValue();
                  pattern.add(suggestedIndexInPath);
              } else {
                  return null;
              }
          }
          return pattern;
      }