private static void registerReplaceInaccessibleFieldWithGetterSetterFix(@NotNull HighlightInfo.Builder builder,
                                                                          @NotNull PsiMember refElement,
                                                                          @NotNull PsiJavaCodeReferenceElement place,
                                                                          @Nullable PsiClass accessObjectClass,
                                                                          @Nullable TextRange parentFixRange) {
    if (refElement instanceof PsiField psiField && place instanceof PsiReferenceExpression ref) {
      if (PsiTypes.nullType().equals(psiField.getType())) return;
      PsiClass containingClass = psiField.getContainingClass();
      if (containingClass != null) {
        if (PsiUtil.isOnAssignmentLeftHand(ref)) {
          PsiMethod setterPrototype = PropertyUtilBase.generateSetterPrototype(psiField);
          PsiMethod setter = containingClass.findMethodBySignature(setterPrototype, true);
          if (setter != null && PsiUtil.isAccessible(setter, ref, accessObjectClass)) {
            PsiElement element = PsiTreeUtil.skipParentsOfType(ref, PsiParenthesizedExpression.class);
            if (element instanceof PsiAssignmentExpression && ((PsiAssignmentExpression)element).getOperationTokenType() == JavaTokenType.EQ) {
              IntentionAction action = QuickFixFactory.getInstance().createReplaceInaccessibleFieldWithGetterSetterFix(ref, setter, true);
              builder.registerFix(action, null, null, parentFixRange, null);
            }
          }
        }
        else if (PsiUtil.isAccessedForReading(ref)) {
          PsiMethod getterPrototype = PropertyUtilBase.generateGetterPrototype(psiField);
          PsiMethod getter = containingClass.findMethodBySignature(getterPrototype, true);
          if (getter != null && PsiUtil.isAccessible(getter, ref, accessObjectClass)) {
            IntentionAction action = QuickFixFactory.getInstance().createReplaceInaccessibleFieldWithGetterSetterFix(ref, getter, false);
            builder.registerFix(action, null, null, parentFixRange, null);
          }
        }
      }
    }
  }
private static void registerReplaceInaccessibleFieldWithGetterSetterFix(@NotNull HighlightInfo.Builder builder,
                                                                          @NotNull PsiMember refElement,
                                                                          @NotNull PsiJavaCodeReferenceElement place,
                                                                          @Nullable PsiClass accessObjectClass,
                                                                          @Nullable TextRange parentFixRange)