private static Function<String, String> wslPathMapper(@NotNull String projectPath) {
    return new Function<>() {
      private Function<String, String> myImpl;

      @Override
      public String apply(String path) {
        if (myImpl != null) {
          return myImpl.apply(path);
        }
        if (WslPath.isWslUncPath(path)) {
          Project project = findProjectByProjectPath(projectPath);
          myImpl = wslPathMapper(project != null ? findWSLDistribution(project) : null);
          return myImpl.apply(path);
        }
        return path;
      }
    };
  }
private static Function<String, String> wslPathMapper(@NotNull String projectPath)