String (@NotNull ChainVariable inVar, @NotNull ChainVariable outVar, @NotNull String code, @NotNull OptionalToIfContext context) { String elseBranch = context.getElseBranch(); List<OperationRecord> records = ContainerUtil.map(myRecords, r -> replaceFnVariable(myVarName, r, inVar, context)); String wrapped = OptionalToIfInspection.wrapCode(context, records, code); context.setElseBranch(elseBranch); return wrapped; }