record (Set<String> mavenLibraries, Map<String, String> jpsNameIndex) { boolean contains(@NotNull String mavenCoords) { if (mavenLibraries.contains(mavenCoords)) return true; if (jpsNameIndex.isEmpty()) return false; String libraryName = getLibraryName(mavenCoords); if (libraryName == null) return false; String existingJpsLibraryName = jpsNameIndex.get(libraryName); if (existingJpsLibraryName == null) return false; return matchLibraryName(existingJpsLibraryName, libraryName); } private static @Nullable String getLibraryName(@NotNull String mavenCoords) { return StringUtil.substringAfter(mavenCoords, ":"); } }