public static <T> List<T> toList(Iterable<T> self) {
        return toList(self.iterator());
    }
public static < T > List < T > toList ( Iterable < T > self ) { return toList ( self . iterator ( ) ) ; }
Convert an Iterable to a List. The Iterable's iterator will
become exhausted of elements after making this conversion.
<p>
Example usage:
<pre class="groovyTestCase">def x = [1,2,3] as HashSet
assert x.class == HashSet
assert x.toList() instanceof List</pre>

@param self an Iterable
@return a List
@since 1.8.7