private static boolean isIfStatementWithoutElse(PsiStatement statement) {
    if (!(statement instanceof PsiIfStatement ifStatement)) {
      return false;
    }
    final PsiStatement elseBranch = ifStatement.getElseBranch();
    return elseBranch == null || isIfStatementWithoutElse(elseBranch);
  }
private static boolean isIfStatementWithoutElse(PsiStatement statement)