private static @Nullable @NonNls String getCollectionsAddAllText(PsiForeachStatement foreachStatement) {
      final PsiStatement body = getBody(foreachStatement);
      if (!(body instanceof PsiExpressionStatement expressionStatement)) return null;
      final PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression)expressionStatement.getExpression();
      final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression();
      final PsiExpression collection = ExpressionUtils.getEffectiveQualifier(methodExpression);
      if (collection == null) return null;
      final PsiExpression iteratedValue = foreachStatement.getIteratedValue();
      if (iteratedValue == null) return null;
      final String arrayText = iteratedValue.getText();
      if (PsiUtil.isLanguageLevel5OrHigher(foreachStatement)) {
        return "java.util.Collections.addAll(" + collection.getText() + ',' + arrayText + ");";
      }
      final String collectionText = ParenthesesUtils.getText(collection, PsiPrecedenceUtil.POSTFIX_PRECEDENCE);
      return collectionText + ".addAll(java.util.Arrays.asList(" + arrayText + "));";
    }
private static @Nullable @NonNls String getCollectionsAddAllText(PsiForeachStatement foreachStatement)