@Override
  public CommonProblemDescriptor @Nullable [] checkElement(@NotNull final RefEntity refEntity,
                                                           @NotNull final AnalysisScope scope,
                                                           @NotNull final InspectionManager manager,
                                                           @NotNull final GlobalInspectionContext globalContext,
                                                           @NotNull final ProblemDescriptionsProcessor processor) {
    if (refEntity instanceof final RefJavaElement refElement) {
      if (refElement instanceof RefParameter) return null;
      if (!refElement.isReferenced()) return null;
      if (refElement.isSyntheticJSP()) return null;
      if (refElement.isFinal()) return null;
      if (!((RefElementImpl)refElement).checkFlag(CanBeFinalAnnotator.CAN_BE_FINAL_MASK)) return null;

      if (refElement instanceof RefClass refClass) {
        if (!isReportClasses()) return null;
        if (refClass.isInterface() || refClass.isAnonymous() || refClass.isAbstract()) return null;
      }
      else if (refElement instanceof RefMethod refMethod) {
        if (!isReportMethods()) return null;
        RefClass ownerClass = refMethod.getOwnerClass();
        if (ownerClass == null || ownerClass.isFinal()) return null;
        if (PsiModifier.PRIVATE.equals(refMethod.getAccessModifier())) return null;
      }
      else if (refElement instanceof RefField field) {
        if (!isReportFields()) return null;
        if (!field.isUsedForWriting()) return null;
      }
      else {
        return null;
      }

      final PsiMember psiMember = ObjectUtils.tryCast(refElement.getPsiElement(), PsiMember.class);
      if (psiMember == null || !CanBeFinalHandler.allowToBeFinal(psiMember)) return null;
      PsiElement psiIdentifier = ((PsiNameIdentifierOwner)psiMember).getNameIdentifier();
      if (psiIdentifier != null) {
        return new ProblemDescriptor[]{manager.createProblemDescriptor(psiIdentifier, JavaAnalysisBundle.message(
          "inspection.export.results.can.be.final.description"), new AcceptSuggested(globalContext.getRefManager()),
                                                                 ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)};
      }
    }
    return null;
  }
@Override
  public CommonProblemDescriptor @Nullable [] checkElement(@NotNull final RefEntity refEntity,
                                                           @NotNull final AnalysisScope scope,
                                                           @NotNull final InspectionManager manager,
                                                           @NotNull final GlobalInspectionContext globalContext,
                                                           @NotNull final ProblemDescriptionsProcessor processor)