What are the easy steps to use IntelliJ idea to replace some code with other code?
A target should be structurally replaced. Select Edit | Find | Replace Structurally from the main menu.
Add new or existing templates to the search and replace template sections in the Replace Structurally dialogue. The replace template can be saved in the same way as the search template.
Place a caret on the variable of interest and utilise the filter area to manage filters if you need to add a filter for the variable in the replace template.
Specify the criteria in the filter section, depending on the filter you selected.