ReplacementVariableDefinition (@NotNull String varName, @NotNull Configuration configuration) { final ReplaceOptions replaceOptions = configuration.getReplaceOptions(); ReplacementVariableDefinition definition = replaceOptions.getVariableDefinition(varName); if (definition != null) { return definition; } return replaceOptions.addNewVariableDefinition(varName); }