Not sure, maybe because in ancient versions of Velocity `#foreach` didn't work on lists. Anyway, feel free to discard the `toArray` calls, I think it's safe to loop on the returned list directly.