@Contract("null,_->null")
  public static @Nullable PsiJavaModule findDescriptorByFile(@Nullable VirtualFile file, @NotNull Project project) {
    if (file == null) return null;
    ProjectFileIndex index = ProjectFileIndex.getInstance(project);
    return index.isInLibrary(file)
           ? findDescriptorInLibrary(project, index, file)
           : findDescriptorByModule(index.getModuleForFile(file), index.isInTestSourceContent(file));
  }
@Contract("null,_->null")
  public static @Nullable PsiJavaModule findDescriptorByFile(@Nullable VirtualFile file, @NotNull Project project)