ExtremumTerminal (PsiStatement @NotNull [] statements, @NotNull TerminalBlock terminalBlock, @Nullable List<? extends PsiVariable> nonFinalVariables) { if (statements.length != 1) return null; PsiStatement statement = statements[0]; PsiIfStatement ifStatement = tryCast(statement, PsiIfStatement.class); if (ifStatement == null) return null; PsiExpression thenCondition = ifStatement.getCondition(); if (thenCondition == null) return null; PsiStatement thenBranch = ControlFlowUtils.stripBraces(ifStatement.getThenBranch()); PsiStatement elseBranch = ControlFlowUtils.stripBraces(ifStatement.getElseBranch()); if (thenBranch == null || elseBranch == null) return null; return extractIfElseCase(thenBranch, thenCondition, elseBranch, terminalBlock, nonFinalVariables); }