void (PsiSwitchBlock block) { CommentTracker ct = new CommentTracker(); PsiSwitchStatement switchStatement = new ReturnSwitchGenerator(block).generate(ct); if (switchStatement == null) return; ct.markUnchanged(block); ct.replaceAndRestoreComments(myReturnStatement, switchStatement); }