PsiClass (Project project, LanguageLevel level) { PsiFile psiFile = PsiFileFactory.getInstance(project).createFileFromText(ARRAY_CLASS_NAME + "." + JavaFileType.INSTANCE.getDefaultExtension(), JavaFileType.INSTANCE.getLanguage(), ARRAY_CLASS_TEXT); PsiUtil.FILE_LANGUAGE_LEVEL_KEY.set(psiFile, level); return ((PsiJavaFile)psiFile).getClasses()[0]; }