Collection<LibraryDescriptor> (ModuleDescriptor module, @Nullable List<? extends LibraryDescriptor> allLibraries) { final Set<LibraryDescriptor> libs = new HashSet<>(); if (allLibraries != null) { for (LibraryDescriptor library : allLibraries) { if (ContainerUtil.intersects(library.getJars(), module.getLibraryFiles())) { libs.add(library); } } } return libs; }