Generic Iterator::collect() method