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