public static < S , T > Iterable < T > transformingIterable ( final Iterable < ? extends S > iterable , final Function < S , ? extends T > function ) { Objects . requireNonNull ( iterable , "The iterable is null" ) ; Objects . requireNonNull ( function , "The function is null" ) ; return new Iterable < T > ( ) { @ Override public Iterator < T > iterator ( ) { return new TransformingIterator < S , T > ( iterable . iterator ( ) , function ) ; } } ; }
Returns an iterable that provides iterators that are transforming the elements provided by the iterators of the given iterable using the given function