boolean (PsiElement element) { if (!(element instanceof PsiTryStatement tryStatement)) { return false; } final PsiCodeBlock finallyBlock = tryStatement.getFinallyBlock(); if (finallyBlock != null) { return false; } final PsiCodeBlock block = tryStatement.getTryBlock(); return block != null; }