@NotNull
  NodeToUpdate findOrCreateByPath(@NotNull String path, @NotNull NewVirtualFileSystem fs) {
    NewVirtualFileSystem currentFS;
    String relativePathInsideJar;
    if (fs instanceof ArchiveFileSystem) {
      currentFS = LocalFileSystem.getInstance();
      int i = path.lastIndexOf(JarFileSystem.JAR_SEPARATOR);
      // strip everything after "!/" and after extractRootFromPath() append it back,
      // because LocalVirtualFileSystem.normalize() is afraid of these jar separators and tries to absolutize them incorrectly (e.g. "C:!/foo" -> "C:idea/bin/!/foo")
      if (i == -1) {
        relativePathInsideJar = JarFileSystem.JAR_SEPARATOR;
      }
      else {
        relativePathInsideJar = path.substring(i);
        path = path.substring(0, i);
      }
    }
    else {
      currentFS = fs;
      relativePathInsideJar = "";
    }
    VfsImplUtil.PathFromRoot pair = VfsImplUtil.extractRootFromPath(currentFS, path);
    String pathFromRoot = pair == null ? path : pair.pathFromRoot();
    pathFromRoot += relativePathInsideJar;
    List<String> names = splitNames(pathFromRoot);
    NewVirtualFile fsRoot = pair == null ? null : pair.root();

    FilePartNode currentNode = this;
    FilePartNode parentNode = this;

    if (fsRoot != null) {
      FilePartNode child = new FilePartNode(getNameId(fsRoot), fsRoot, currentFS);
      int index = binarySearchChildByName(fsRoot.getNameSequence());
      if (index >= 0) {
        currentNode = currentNode.children[index];
      }
      else {
        currentNode.children = ArrayUtil.insert(currentNode.children, -index - 1, child);
        if (currentNode.children.length >= 2) {
          // it's expected that there won't be a lot of roots, so sorting should be cheap
          Arrays.sort(currentNode.children, (c1, c2) -> StringUtil.compare(c1.getName(), c2.getName(), !isCaseSensitive()));
        }
        currentNode = child;
      }
    }

    return trieDescend(fs, currentFS, names, fsRoot, currentNode, parentNode);
  }
@NotNull
  NodeToUpdate findOrCreateByPath(@NotNull String path, @NotNull NewVirtualFileSystem fs)