boolean (PsiElement element) { if (!(element instanceof PsiStatement statement)) { return false; } final PsiElement lastLeaf = PsiTreeUtil.getDeepestLast(statement); if (PsiUtil.isJavaToken(lastLeaf, JavaTokenType.SEMICOLON) && PsiTreeUtil.prevLeaf(lastLeaf) instanceof PsiErrorElement) { return false; } return isBooleanReturn(statement) || isBooleanAssignment(statement) || isBooleanDeclaration(statement); }