void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiElement element = startElement.getParent(); if (!(element instanceof PsiIfStatement ifStatement)) { return; } if (HighlightingFeature.PATTERNS_IN_SWITCH.isAvailable(ifStatement)) { for (PsiIfStatement ifStatementInChain : getAllConditionalBranches(ifStatement)) { replaceCastsWithPatternVariable(ifStatementInChain); } } replaceIfWithSwitch(ifStatement, updater); }