String (@NotNull String workingDirectory) { MavenProjectsManager manager = MavenProjectsManager.getInstance(myProject); if (!manager.isMavenizedProject()) { return FileUtilRt.toSystemIndependentName(calculateMultimoduleDirUpToFileTree(workingDirectory)); } return FileUtilRt.toSystemIndependentName(manager.getRootProjects().stream() .map(MavenProject::getDirectory) .filter(rpDirectory -> FileUtil.isAncestor(rpDirectory, workingDirectory, false)) .findFirst() .orElseGet(() -> calculateMultimoduleDirUpToFileTree(workingDirectory))); }