boolean (Collection<MavenProject> mavenProjects) { Set<String> exitingGroups = new HashSet<>(); for (MavenProject mavenProject : mavenProjects) { if (!exitingGroups.add(mavenProject.getMavenId().getGroupId())) { return false; } } return true; }