void (LanguageLevel languageLevel, Runnable runnable) { Module module = getModule(); LanguageLevel prev = LanguageLevelUtil.getCustomLanguageLevel(module); IdeaTestUtil.setModuleLanguageLevel(module, languageLevel); try { runnable.run(); } finally { IdeaTestUtil.setModuleLanguageLevel(module, prev); } }