PsiElement (@NotNull PsiCodeBlock finallyBlock) { PsiElement finallyElement = finallyBlock; while (!PsiUtil.isJavaToken(finallyElement, JavaTokenType.FINALLY_KEYWORD) && finallyElement != null) { finallyElement = finallyElement.getPrevSibling(); } assert finallyElement != null : finallyBlock.getParent().getText(); return finallyElement; }