void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiLoopStatement loopStatement = tryCast(element, PsiLoopStatement.class); if (loopStatement == null) return; StreamSource source = StreamSource.tryCreate(loopStatement); PsiStatement body = loopStatement.getBody(); if(body == null || source == null) return; TerminalBlock tb = TerminalBlock.from(source, body); PsiElement result = myMigration.migrate(project, body, tb); if (result == null) return; tb.operations().forEach(StreamApiMigrationInspection.Operation::cleanUp); simplify(project, result); }