Set<String> () { Set<String> usedNames = new HashSet<>(); for (JpsArtifact artifact : JpsArtifactService.getInstance().getArtifacts(myProject)) { usedNames.add(artifact.getName()); } return usedNames; }