void () { LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_3); IdeaTestUtil.setModuleLanguageLevel(getModule(), LanguageLevel.JDK_1_7); PsiDirectory dir = getPsiManager().findDirectory(myFixture.getTempDirFixture().getFile("")); PsiClass createdEnum = JavaDirectoryService.getInstance().createEnum(dir, "Foo"); assertTrue(createdEnum.isEnum()); assertEquals(LanguageLevel.JDK_1_7, PsiUtil.getLanguageLevel(createdEnum)); }