void (PsiElement element, Context context) { PsiSwitchLabeledRuleStatement rule = (PsiSwitchLabeledRuleStatement)element; PsiSwitchBlock block = rule.getEnclosingSwitchBlock(); PsiStatement body = rule.getBody(); assert body instanceof PsiExpressionStatement; context.extractElement(((PsiExpressionStatement)body).getExpression(), block); context.deleteExactly(block); }