public static <E> List<Tuple2<E, Integer>> withIndex(Iterable<E> self) {
        return withIndex(self, 0);
    }
public static < E > List < Tuple2 < E , Integer > > withIndex ( Iterable < E > self ) { return withIndex ( self , 0 ) ; }
Zips an Iterable with indices in (value, index) order.
<p/>
Example usage:
<pre class="groovyTestCase">
assert [["a", 0], ["b", 1]] == ["a", "b"].withIndex()
assert ["0: a", "1: b"] == ["a", "b"].withIndex().collect { str, idx {@code ->} "$idx: $str" }
</pre>

@param self an Iterable
@return a zipped list with indices
@see #indexed(Iterable)
@since 2.4.0