PsiNewExpression (@NonNls final String body) { final PsiFile file = createFile("test.java", "class Test { " + body + "class ClassIOException { ClassIOException() throws java.io.IOException {} }" + "class ClassError { ClassError() throws Error {} }" + "class ClassRuntime { ClassRuntime() throws RuntimeException {} }" + "}"); PsiNewExpression newExpression = findNewExpression(file); assertNotNull(newExpression); return newExpression; }