public static boolean collectVariableData(PsiMember member, InternalUsageInfo[] internalUsages,
                                            ArrayList<? super VariableData> variableDatum) {
    HashSet<PsiField> reported = new HashSet<>();
    HashSet<PsiField> accessedForWriting = new HashSet<>();
    boolean needClassParameter = false;
    for (InternalUsageInfo usage : internalUsages) {
      final PsiElement referencedElement = usage.getReferencedElement();
      if (usage.isWriting()) {
        accessedForWriting.add((PsiField)referencedElement);
        needClassParameter = true;
      }
      else if (referencedElement instanceof PsiField field) {
        reported.add(field);
      }
      else {
        needClassParameter = true;
      }
    }

    final ArrayList<PsiField> psiFields = new ArrayList<>(reported);
    psiFields.sort(Comparator.comparing(PsiField::getName));
    for (final PsiField field : psiFields) {
      if (accessedForWriting.contains(field)) continue;
      VariableData data = new VariableData(field);
      JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(member.getProject());
      String name = field.getName();
      name = codeStyleManager.variableNameToPropertyName(name, VariableKind.FIELD);
      name = codeStyleManager.propertyNameToVariableName(name, VariableKind.PARAMETER);
      name = CommonJavaRefactoringUtil.suggestUniqueVariableName(name, member, field);
      data.name = name;
      data.passAsParameter = true;
      variableDatum.add(data);
    }
    return needClassParameter;
  }
public static boolean collectVariableData(PsiMember member, InternalUsageInfo[] internalUsages,
                                            ArrayList<? super VariableData> variableDatum)