@Internal
  public static @Nullable OrderEntry libraryEntry(@NotNull Project project, @NotNull PsiElement psiElement) {
    PsiFile containingFile = psiElement.getContainingFile();
    if (containingFile != null) {
      return libraryEntry(project, containingFile);
    }
    else if (psiElement instanceof PsiDirectoryContainer) {
      PsiDirectory[] directories = ((PsiDirectoryContainer)psiElement).getDirectories();
      for (PsiDirectory directory : directories) {
        OrderEntry libraryEntry = libraryEntry(project, directory);
        if (libraryEntry != null) {
          return libraryEntry;
        }
      }
      return null;
    }
    else {
      return null;
    }
  }
@Internal
  public static @Nullable OrderEntry libraryEntry(@NotNull Project project, @NotNull PsiElement psiElement)