PsiClass (final String className) { final PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(getPackageDirectory()); for (PsiClass aClass : classes) { if (aClass.getName().equals(className)) { return aClass; } } TestCase.fail(className + " not found"); return null; }