void () { PsiMethodCallExpression methodCall = createCall("void foo() { try { throwsIOException(); } catch (java.io.Exception e) {} }"); PsiTryStatement statement = PsiTreeUtil.getParentOfType(methodCall, PsiTryStatement.class); final Collection<PsiClassType> exceptions = ExceptionUtil.collectUnhandledExceptions(statement.getTryBlock(), statement.getTryBlock()); assertEquals(1, exceptions.size()); assertEquals("java.io.IOException", exceptions.iterator().next().getCanonicalText()); }