Collection<String> (Collection<MavenProfile> profiles) { if (profiles == null) return Collections.emptyList(); Set<String> result = new HashSet<>(profiles.size()); for (MavenProfile each : profiles) { result.add(each.getId()); } return result; }