@Override
  public boolean annotate(@NotNull Header header, @NotNull AnnotationHolder holder) {
    HeaderValue value = header.getHeaderValue();
    if (!(value instanceof HeaderValuePart valuePart)) return false;

    String className = valuePart.getUnwrappedText();
    if (StringUtil.isEmptyOrSpaces(className)) {
      holder.newAnnotation(HighlightSeverity.ERROR, ManifestBundle.message("header.reference.invalid")).range(valuePart.getHighlightingRange()).create();
      return true;
    }

    Project project = header.getProject();
    Module module = ModuleUtilCore.findModuleForPsiElement(header);
    GlobalSearchScope scope = module != null ? module.getModuleWithDependenciesAndLibrariesScope(false) : ProjectScope.getAllScope(project);
    PsiClass aClass = JavaPsiFacade.getInstance(project).findClass(className, scope);
    if (aClass == null) {
      String message = JavaErrorBundle.message("error.cannot.resolve.class", className);
      holder.newAnnotation(HighlightSeverity.ERROR, message).range(valuePart.getHighlightingRange())
      .highlightType(ProblemHighlightType.LIKE_UNKNOWN_SYMBOL).create();
      return true;
    }

    return checkClass(valuePart, aClass, holder);
  }
@Override
  public boolean annotate(@NotNull Header header, @NotNull AnnotationHolder holder)