docs: @SuppressWarnings("PMD.UselessParentheses")
      public Schema create(Schema parent, String path, String refFragmentPathDelimiters) {
  
          if (!path.equals("#")) {
              // if path is an empty string then resolving it below results in jumping up a level. e.g. "/path/to/file.json" becomes "/path/to"
              path = stripEnd(path, "#?&/");
          }
  
          // encode the fragment for any funny characters
          if (path.contains("#")) {
              String pathExcludingFragment = substringBefore(path, "#");
              String fragment = substringAfter(path, "#");
              URI fragmentURI;
              try {
                  fragmentURI = new URI(null, null, fragment);
              } catch (URISyntaxException e) {
                  throw new IllegalArgumentException("Invalid fragment: " + fragment + " in path: " + path);
              }
              path = pathExcludingFragment + "#" + fragmentURI.getRawFragment();
          }
  
          URI id = (parent == null || parent.getId() == null) ? URI.create(path) : parent.getId().resolve(path);
  
          String stringId = id.toString();
          if (stringId.endsWith("#")) {
              try {
                  id = new URI(stripEnd(stringId, "#"));
              } catch (URISyntaxException e) {
                  throw new IllegalArgumentException("Bad path: " + stringId);
              }
          }
  
          if (selfReferenceWithoutParentFile(parent, path) || substringBefore(stringId, "#").isEmpty()) {
              JsonNode parentContent = parent.getParent().getContent();
              Schema schema = new Schema(id, fragmentResolver.resolve(parentContent, path, refFragmentPathDelimiters), parent.getParent());
              schemas.put(id, schema);
              return schema;
          }
  
          return create(id, refFragmentPathDelimiters);
  
      }