Groovy’s equivalent of Scala’s zip is List#transpose, which can be called on a list of lists:
assert [[1, 2, 3], [4, 5]].transpose() == [[1, 4], [2, 5]]
Groovy’s equivalent of Scala’s zip is List#transpose, which can be called on a list of lists:
assert [[1, 2, 3], [4, 5]].transpose() == [[1, 4], [2, 5]]