@Nullable
  private static ModuleNode findLibraryNode(@NotNull Map<String, Set<ModuleNode>> packagesDeclaredInModules,
                                            @NotNull Map<PsiJavaModule, ModuleNode> nodeByDescriptor,
                                            @NotNull Project project,
                                            @NotNull Library library) {
    final PsiJavaModule descriptor = ReadAction.compute(() -> JavaModuleGraphUtil.findDescriptorByLibrary(library, project));
    if (descriptor == null) return null;

    final ModuleNode node = nodeByDescriptor.computeIfAbsent(descriptor, d -> new ModuleNode(d));
    for (PsiPackageAccessibilityStatement export : descriptor.getExports()) {
      final String packageName = export.getPackageName();
      if (packageName != null) packagesDeclaredInModules.computeIfAbsent(packageName, l -> new HashSet<>()).add(node);
    }
    return node;
  }
@Nullable
  private static ModuleNode findLibraryNode(@NotNull Map<String, Set<ModuleNode>> packagesDeclaredInModules,
                                            @NotNull Map<PsiJavaModule, ModuleNode> nodeByDescriptor,
                                            @NotNull Project project,
                                            @NotNull Library library)