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