void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiElement parent = startElement.getParent(); if (!(parent instanceof PsiIfStatement ifStatement)) { return; } @NonNls final StringBuilder newStatementText = new StringBuilder("assert "); CommentTracker tracker = new CommentTracker(); newStatementText.append(BoolUtils.getNegatedExpressionText(ifStatement.getCondition(), tracker)); final PsiNewExpression newException = getThrownNewException(ifStatement.getThenBranch()); final String message = getExceptionMessage(newException, tracker); if (message != null) { newStatementText.append(':').append(message); } newStatementText.append(';'); PsiReplacementUtil.replaceStatement(ifStatement, newStatementText.toString(), tracker); }