public static < T > Iterator < T > join ( Collection < Iterable < T > > iterables ) { Queue < Iterator < T >> iters = new ArrayDeque < Iterator < T > > ( iterables . size ( ) ) ; for ( Iterable < T > i : iterables ) iters . ( i . iterator ( ) ) ; return new CombinedIterator < T > ( iters ) ; }
Joins the iterators of all the provided iterables as one unified iterator .