String (PsiIfStatement firstStatement, PsiIfStatement secondStatement, CommentTracker tracker) { final PsiExpression condition = firstStatement.getCondition(); final String conditionText = condition == null ? "" : tracker.text(condition); final PsiStatement firstThenBranch = firstStatement.getThenBranch(); final PsiStatement secondThenBranch = secondStatement.getThenBranch(); @NonNls String statement = "if(" + conditionText + ')' + printStatementsInSequence(firstThenBranch, secondThenBranch, tracker); final PsiStatement firstElseBranch = firstStatement.getElseBranch(); final PsiStatement secondElseBranch = secondStatement.getElseBranch(); if (firstElseBranch != null || secondElseBranch != null) { if (firstElseBranch instanceof PsiIfStatement && secondElseBranch instanceof PsiIfStatement && MergeParallelIfsPredicate.ifStatementsCanBeMerged((PsiIfStatement)firstElseBranch, (PsiIfStatement)secondElseBranch)) { statement += "else " + mergeIfStatements((PsiIfStatement)firstElseBranch, (PsiIfStatement)secondElseBranch, tracker); } else { statement += "else" + printStatementsInSequence(firstElseBranch, secondElseBranch, tracker); } } return statement; }