Google Collections has an Iterables utility class for taking in a collection and iterable and putting all the elements from iterable into the collection, called addAll. Is there something similar when all you have is an iterator?
Google Collections has an Iterables utility class for taking in a collection and iterable
Share
Yes, and it’s called
Iterators.addAll(Collection, Iterator), unsurprisingly.