@NotNull
  private static DependencyScope getScope(@NotNull PsiJavaModule descriptor) {
    PsiFile file = descriptor.getContainingFile().getOriginalFile();
    Module module = ModuleUtilCore.findModuleForFile(file);
    if (module == null) return DependencyScope.COMPILE;

    return ModuleRootManager.getInstance(module).getFileIndex()
             .isInTestSourceContent(file.getVirtualFile())
           ? DependencyScope.TEST
           : DependencyScope.COMPILE;
  }
@NotNull
  private static DependencyScope getScope(@NotNull PsiJavaModule descriptor)