OperationRecord (@NotNull String oldName, @NotNull OperationRecord record, @NotNull ChainVariable outerVar, @NotNull OptionalToIfContext context) { ChainVariable inVar = replaceFnVariable(oldName, record.myInVar, outerVar); ChainVariable outVar = replaceFnVariable(oldName, record.myOutVar, outerVar); Operation operation = record.myOperation; operation.rename(oldName, outerVar, context); return new OperationRecord(inVar, outVar, operation); }