public static void simplifyExpression(PsiExpression expression) throws IncorrectOperationException {
    final PsiExpression result = createSimplifiedReplacement(expression);
    PsiExpression newExpression = (PsiExpression)new CommentTracker().replaceAndRestoreComments(expression, result);
    if (newExpression instanceof PsiLiteralExpression literal) {
      final PsiElement parent = newExpression.getParent();
      Object value = literal.getValue();
      if (parent instanceof PsiAssertStatement && Boolean.TRUE.equals(value)) {
        parent.delete();
        return;
      }
      if (parent instanceof PsiSwitchLabelStatementBase label && PsiTreeUtil.isAncestor(label.getGuardExpression(), newExpression, false)) {
        if (Boolean.TRUE.equals(value)) {
          CommentTracker tracker = new CommentTracker();
          PsiExpression guardExpression = label.getGuardExpression();
          PsiKeyword psiKeyword = PsiTreeUtil.getPrevSiblingOfType(guardExpression, PsiKeyword.class);
          if (psiKeyword != null && psiKeyword.getTokenType() == WHEN_KEYWORD) {
            tracker.delete(psiKeyword);
          }
          tracker.delete(guardExpression);
          return;
        }
        if (Boolean.FALSE.equals(value)) {
          DeleteSwitchLabelFix.deleteLabel(label);
          return;
        }
      }
    }
    if (!simplifyIfOrLoopStatement(newExpression)) {
      ParenthesesUtils.removeParentheses(newExpression, false);
    }
  }
public static void simplifyExpression(PsiExpression expression)