boolean (PsiElement element) { if (!(element instanceof PsiJavaToken javaToken)) { return false; } final IElementType tokenType = javaToken.getTokenType(); if (!JavaTokenType.TRY_KEYWORD.equals(tokenType)) { return false; } final PsiElement parent = element.getParent(); if (!isSimpleTry(parent)) { return false; } final PsiTryStatement tryStatement = (PsiTryStatement)parent; final PsiCodeBlock block = tryStatement.getTryBlock(); if (block == null) { return false; } final PsiStatement[] statements = block.getStatements(); if (statements.length != 1) { return false; } final PsiStatement statement = statements[0]; return isSimpleTry(statement); }