Populating a collection using an iterator

Google Collections has an Iterables utility class for collecting collections and iterating and putting all items from iterability into a collection called addAll. Is there something like this when all you have is an iterator?

+3
source share
1 answer

Yes, and he called Iterators.addAll(Collection, Iterator), no wonder.

+11
source

Source: https://habr.com/ru/post/1732591/


All Articles