void (PsiExpression result, PsiStatement statement) { List<PsiExpression> sideEffects = SideEffectChecker.extractSideEffectExpressions(result); if (Objects.equals(Collections.singletonList(result), sideEffects)) return; PsiStatement[] statements = StatementExtractor.generateStatements(sideEffects, result); if (statements.length > 0) { PsiStatement lastAdded = BlockUtils.addBefore(statement, statements); statement = Objects.requireNonNull(PsiTreeUtil.getNextSiblingOfType(lastAdded, PsiStatement.class)); } statement.delete(); }