public static <T> Collection<Pair<T, Integer>> zipWithIndex(Iterable<T> iterable)
    {
        if (iterable instanceof MutableCollection)
        {
            return ((MutableCollection<T>) iterable).zipWithIndex();
        }
        if (iterable instanceof ArrayList)
        {
            return ArrayListIterate.zipWithIndex((ArrayList<T>) iterable);
        }
        if (iterable instanceof RandomAccess)
        {
            return RandomAccessListIterate.zipWithIndex((List<T>) iterable);
        }
        if (iterable instanceof Collection)
        {
            return IterableIterate.zipWithIndex(
                    iterable,
                    DefaultSpeciesNewStrategy.INSTANCE.<Pair<T, Integer>>speciesNew(
                            (Collection<T>) iterable,
                            ((Collection<T>) iterable).size()));
        }
        if (iterable != null)
        {
            return IterableIterate.zipWithIndex(iterable);
        }
        throw new IllegalArgumentException("Cannot perform a zipWithIndex on null");
    }
public static < T > Collection < Pair < T , Integer > > zipWithIndex ( Iterable < T > iterable ) { if ( iterable instanceof MutableCollection ) { return ( ( MutableCollection < T > ) iterable ) . zipWithIndex ( ) ; } if ( iterable instanceof ArrayList ) { return ArrayListIterate . zipWithIndex ( ( ArrayList < T > ) iterable ) ; } if ( iterable instanceof RandomAccess ) { return RandomAccessListIterate . zipWithIndex ( ( List < T > ) iterable ) ; } if ( iterable instanceof Collection ) { return IterableIterate . zipWithIndex ( iterable , DefaultSpeciesNewStrategy . INSTANCE . < Pair < T , Integer > > speciesNew ( ( Collection < T > ) iterable , ( ( Collection < T > ) iterable ) . size ( ) ) ) ; } if ( iterable != null ) { return IterableIterate . zipWithIndex ( iterable ) ; } throw new IllegalArgumentException ( "Cannot perform a zipWithIndex on null" ) ; }
@see RichIterable#zipWithIndex()