void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiLoopStatement loop = tryCast(startElement.getParent(), PsiLoopStatement.class); String newExpression = null; if (loop instanceof PsiForStatement) { newExpression = getCollectionsAddAllText((PsiForStatement)loop); } else if (loop instanceof PsiForeachStatement) { newExpression = getCollectionsAddAllText((PsiForeachStatement)loop); } if (newExpression == null) return; PsiReplacementUtil.replaceStatementAndShortenClassNames(loop, newExpression); }