void (String intentionText) { final CommonCodeStyleSettings settings = CodeStyle.getSettings(getProject()).getCommonSettings(JavaLanguage.INSTANCE); final int oldValue = settings.IF_BRACE_FORCE; try { settings.IF_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_ALWAYS; doTest(intentionText); } finally { settings.IF_BRACE_FORCE = oldValue; } }