@NotNull
  private static Collection<PsiAnnotation> getAnnotationCandidates(@NotNull PsiClass annClass,
                                                                   @NotNull SearchScope useScope, @NotNull Project project) {
    return ReadAction.compute(() -> {
      if (useScope instanceof GlobalSearchScope) {
        return JavaAnnotationIndex.getInstance().getAnnotations(annClass.getName(), project, (GlobalSearchScope)useScope);
      }

      List<PsiAnnotation> result = new ArrayList<>();
      for (PsiElement element : ((LocalSearchScope)useScope).getScope()) {
        result.addAll(PsiTreeUtil.findChildrenOfType(element, PsiAnnotation.class));
      }
      return result;
    });
  }
@NotNull
  private static Collection<PsiAnnotation> getAnnotationCandidates(@NotNull PsiClass annClass,
                                                                   @NotNull SearchScope useScope, @NotNull Project project)