public static <T> List<List<T>> inits(Iterable<T> self) {
        return GroovyCollections.inits(self);
    }
public static < T > List < List < T > > inits ( Iterable < T > self ) { return GroovyCollections . inits ( self ) ; }
Calculates the init values of this Iterable: the first value will be this list of all items from the iterable and the final one will be an empty list, with the intervening values the results of successive applications of init on the items.
<pre class="groovyTestCase">
assert [1, 2, 3, 4].inits() == [[1, 2, 3, 4], [1, 2, 3], [1, 2], [1], []]
</pre>

@param self an Iterable
@return a List of the init values from the given Iterable
@since 2.5.0