IntelliJ IDEA IDE offers "Introduce variable" refactoring feature. Popup shown by the variable being introduced allow to "Specify type explicitly" (switchabl