private static List<PsiIfStatement> getAllConditionalBranches(PsiIfStatement ifStatement){
    List<PsiIfStatement> ifStatements = new ArrayList<>();
    while (ifStatement != null) {
      ifStatements.add(ifStatement);
      PsiStatement elseBranch = ifStatement.getElseBranch();
      if (elseBranch instanceof PsiIfStatement) {
        ifStatement = (PsiIfStatement) elseBranch;
      } else {
        ifStatement = null;
      }
    }
    return ifStatements;
  }
private static List<PsiIfStatement> getAllConditionalBranches(PsiIfStatement ifStatement)