void (@NotNull ExtractMethodProcessor from, @NotNull Map<PsiVariable, PsiVariable> variablesMapping) { myMethodName = from.myMethodName != null ? from.myMethodName : "dummyMethodName"; myStatic = from.myStatic; myIsChainedConstructor = from.myIsChainedConstructor; myMethodVisibility = from.myMethodVisibility; myNullability = from.myNullability; myReturnType = from.myReturnType; myOutputVariables = Arrays.stream(from.myOutputVariables) .map(variable -> variablesMapping.getOrDefault(variable, variable)) .toArray(PsiVariable[]::new); myOutputVariable = ArrayUtil.getFirstElement(myOutputVariables); myArtificialOutputVariable = variablesMapping.getOrDefault(from.myArtificialOutputVariable, from.myArtificialOutputVariable); List<VariableData> variableDatum = new ArrayList<>(); List<VariableData> inputVariables = getInputVariables().getInputVariables(); for (int i = 0; i < from.myVariableDatum.length; i++) { VariableData fromData = from.myVariableDatum[i]; PsiVariable mappedVariable = variablesMapping.get(fromData.variable); if (isReferenced(mappedVariable, fromData.variable) && isUnchanged(mappedVariable, fromData.type, inputVariables)) { VariableData newData = fromData.substitute(mappedVariable); variableDatum.add(newData); } } Set<PsiVariable> parameterVariables = ContainerUtil.map2Set(variableDatum, data -> data.variable); for (VariableData data : inputVariables) { if (!parameterVariables.contains(data.variable)) { variableDatum.add(data); } } myVariableDatum = variableDatum.toArray(new VariableData[0]); }