private static boolean ifStatementMayReturnBeforeRecursing(
    PsiIfStatement ifStatement, PsiMethod method) {
    final PsiExpression test = ifStatement.getCondition();
    if (expressionDefinitelyRecurses(test, method)) {
      return false;
    }
    final PsiStatement thenBranch = ifStatement.getThenBranch();
    if (statementMayReturnBeforeRecursing(thenBranch, method)) {
      return true;
    }
    final PsiStatement elseBranch = ifStatement.getElseBranch();
    return elseBranch != null &&
           statementMayReturnBeforeRecursing(elseBranch, method);
  }
private static boolean ifStatementMayReturnBeforeRecursing(
    PsiIfStatement ifStatement, PsiMethod method)