public static Map<MavenProject, String> generateNameMap(Collection<MavenProject> mavenProjects) {
    MultiMap<String, MavenProject> artifactIdMap = new MultiMap<>();

    for (MavenProject project : mavenProjects) {
      artifactIdMap.putValue(project.getMavenId().getArtifactId(), project);
    }

    Map<MavenProject, String> res = new HashMap<>();

    for (Map.Entry<String, Collection<MavenProject>> entry : artifactIdMap.entrySet()) {
      List<MavenProject> projectList = (List<MavenProject>)entry.getValue();
      String artifactId = entry.getKey();

      if (projectList.size() == 1) {
        res.put(projectList.get(0), artifactId);
      }
      else if (allGroupsAreDifferent(projectList)) {
        for (MavenProject mavenProject : projectList) {
          res.put(mavenProject, mavenProject.getMavenId().getGroupId() + ':' + mavenProject.getMavenId().getArtifactId());
        }
      } else if (allGroupsEqual(mavenProjects)) {
        for (MavenProject mavenProject : projectList) {
          res.put(mavenProject, mavenProject.getMavenId().getArtifactId() + ':' + mavenProject.getMavenId().getVersion());
        }
      }
      else {
        for (MavenProject mavenProject : projectList) {
          MavenId mavenId = mavenProject.getMavenId();
          res.put(mavenProject, mavenId.getGroupId() + ':' + mavenId.getArtifactId() + ':' + mavenId.getVersion());
        }
      }
    }

    return res;
  }
public static Map<MavenProject, String> generateNameMap(Collection<MavenProject> mavenProjects)