@VisibleForTesting
  static @Nullable NewVirtualFileSystem detectFileSystem(@NotNull String rootUrl,
                                                         @NotNull String rootPath) {

    if (rootUrl.endsWith(":")) {
      if (OSAgnosticPathUtil.startsWithWindowsDrive(rootUrl) && rootUrl.length() == 2) {
        //Workaround for IDEA-331415: it shouldn't happen: rootUrl must be an url (even though sometimes not
        // fully correct URL), not a win-path -- but it sometimes happens, even though shouldn't:
        LOG.warn("detectFileSystem[root url='" + rootUrl + "', path='" + rootPath + "']: root URL is not an URL, but Win drive path");
        return LocalFileSystem.getInstance();
        //TODO RC: I hope this was just a fluck -- i.e. some VFS instances somehow got 'infected' by these wrong
        // root urls, but they wash off with time -- and the need for this branch disappears. Lets replace the
        // workaround with an AssertionError in v24.1, and see.
      }

      //We truncated all trailing '/' in the .findRoot(), before putting rootUrl into FSRecords.findOrCreateRoot()
      // -- now we need to append them back, otherwise .extractProtocol() won't recognize the protocol
      // E.g. 'file:' -> 'file:///'
      rootUrl += "///";
    }

    String protocol = VirtualFileManager.extractProtocol(rootUrl);
    VirtualFileSystem fs = VirtualFileManager.getInstance().getFileSystem(protocol);
    if (fs instanceof NewVirtualFileSystem) {
      return (NewVirtualFileSystem)fs;
    }

    if (fs == null) {
      LOG.warn("\tcan't force caching " + rootUrl + " (protocol: " + protocol + ", path: " + rootPath + ") " +
               "-> protocol:'" + protocol + "' is not registered (yet?)");
    }
    else {
      LOG.warn("\tcan't force caching " + rootUrl + " (protocol: " + protocol + ", path: " + rootPath + ") " +
               "-> " + fs + " is not NewVirtualFileSystem");
    }
    return null;
  }
@VisibleForTesting
  static @Nullable NewVirtualFileSystem detectFileSystem(@NotNull String rootUrl,
                                                         @NotNull String rootPath)