void (boolean on, Runnable test) { CodeInsightSettings settings = CodeInsightSettings.getInstance(); boolean oldQuote = settings.AUTOINSERT_PAIR_QUOTE; try { settings.AUTOINSERT_PAIR_QUOTE = on; test.run(); } finally { settings.AUTOINSERT_PAIR_QUOTE = oldQuote; } }