void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { final GrIfStatement parentStatement = (GrIfStatement) element; GrBlockStatement elseBlockStatement = (GrBlockStatement) parentStatement.getElseBranch(); assert elseBlockStatement != null; final GrOpenBlock elseBranch = elseBlockStatement.getBlock(); final GrStatement elseBranchContents = elseBranch.getStatements()[0]; PsiImplUtil.replaceStatement("if(" + parentStatement.getCondition().getText() + ")" + parentStatement.getThenBranch().getText() + "else " + elseBranchContents.getText(), parentStatement); }