private static boolean isElseBranch(@NotNull PsiExpression expression, @NotNull PsiElement statementParent) {
    if (statementParent instanceof PsiIfStatement ifStatement) {
      PsiStatement elseBranch = ifStatement.getElseBranch();
      if (elseBranch != null && elseBranch.getFirstChild() == expression) {
        return true;
      }
    }
    return false;
  }
private static boolean isElseBranch(@NotNull PsiExpression expression, @NotNull PsiElement statementParent)