boolean (@NotNull MavenProject newAggregator, @NotNull MavenProject project) { MavenProject prevAggregator = findAggregator(project); if (prevAggregator == newAggregator) return false; withWriteLock(() -> { if (prevAggregator != null) { removeModule(prevAggregator, project); } else { myRootProjects.remove(project); } addModule(newAggregator, project); }); return true; }