void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiSwitchBlock switchBlock = tryCast(element instanceof PsiSwitchBlock ? element : element.getParent(), PsiSwitchBlock.class); if (switchBlock == null) return; Replacer replacer = findReplacer(switchBlock); if (replacer == null) return; replacer.replace(switchBlock); }