void () { final LanguageLevelProjectExtension levelProjectExtension = LanguageLevelProjectExtension.getInstance(getProject()); final LanguageLevel level = levelProjectExtension.getLanguageLevel(); try { levelProjectExtension.setLanguageLevel(LanguageLevel.JDK_1_8); doTest("A", "B", 0); } finally { levelProjectExtension.setLanguageLevel(level); } }