private static @NotNull ModCommand performForConstructorsAndFields(ActionContext context, List<PsiField> fields, List<PsiMethod> constructors) {
    return ModCommand.psiUpdate(context, updater -> {
      List<PsiField> writableFields = ContainerUtil.map(fields, updater::getWritable);
      PsiClass psiClass = writableFields.get(0).getContainingClass();
      if (psiClass == null) return;
      List<PsiMethod> writableConstructors;
      if (constructors.isEmpty()) {
        writableConstructors = List.of(AddDefaultConstructorFix.addDefaultConstructor(psiClass));
      }
      else {
        writableConstructors = ContainerUtil.map(constructors, updater::getWritable);
      }
      for (PsiMethod constructor : writableConstructors) {
        updater.trackDeclaration(constructor);
      }
      Map<PsiMethod, ChainedConstructorData> data = ChainedConstructorData.getChainedConstructorDataMap(writableFields, writableConstructors);
      Map<PsiMethod, List<PsiVariable>> params = StreamEx.of(writableConstructors)
        .toMap(ctr -> fillVariables(writableFields, ctr.getParameterList()));
      for (PsiMethod constructor : writableConstructors) {
        addParameterToConstructor(context, constructor, updater, data.get(constructor), params.get(constructor));
      }
    });
  }
private static @NotNull ModCommand performForConstructorsAndFields(ActionContext context, List<PsiField> fields, List<PsiMethod> constructors)