void (MavenProject mavenProject, List<MavenProject> prevModules, List<VirtualFile> existingModuleFiles) { var removedModules = ContainerUtil.filter(prevModules, prevModule -> !existingModuleFiles.contains(prevModule.getFile())); for (MavenProject module : removedModules) { VirtualFile moduleFile = module.getFile(); if (tree.isManagedFile(moduleFile)) { if (tree.reconnectRoot(module)) { updateContext.updated(module, MavenProjectChanges.NONE); } } else { tree.removeModule(mavenProject, module); tree.doDelete(mavenProject, module, updateContext); } } }