PsiClass () { PsiFile file = myFixture.getFile(); assertInstanceOf(file, PsiJavaFile.class); PsiClass[] classes = ((PsiJavaFile)file).getClasses(); assertTrue(classes.length > 0); return classes[0]; }