void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { BranchFixContext context = new BranchFixContext(); if (context.prepare(element, BranchBase::isDefault)) { context.deleteBranchLabel(); if (!context.myBranchToDelete.hasSingleNullCase()) { /* switch (obj) { case R(): case null: case S(): <caret>return 42; // Branch in 'switch' is a duplicate of the default branch case String s: return 0; default: return 42; } The 'case R():' and 'case S():' statements can be removed as redundant, because the corresponding branch is a duplicate of the default branch. But the 'default' case does not handle null values, so we cannot delete the 'case null:' and the 'return 42;' statement. See com.intellij.java.codeInspection.DuplicateBranchesInSwitchFixTest [DeleteRedundantBranch7.java] */ context.deleteStatements(); } } }