PsiElement (@NotNull PsiTryStatement tryStatement) { PsiCodeBlock tryBlock = tryStatement.getTryBlock(); if (tryBlock == null) return null; PsiCatchSection[] catchSections = tryStatement.getCatchSections(); if (catchSections.length == 0) return null; if (containsEmptyCatchBlockWithAssertionError(catchSections)) { PsiElement lastPsiElement = PsiTreeUtil.skipWhitespacesAndCommentsBackward(tryBlock.getLastBodyElement()); if (lastPsiElement instanceof PsiAssertStatement) return lastPsiElement; return containsOnlyEmptyCatchBlocksWithAssertionErrorInheritors(catchSections) ? lastPsiElement : null; } return null; }