Q:

Is there any implementation of a MergeIterator?

Does any of the existing collection libraries (guava, commons-collection) provide a MergeIterator that's constructed with:
MergeIterator(Iterator<Comparable> iters...)

and then (assuming the source iterators are sorted) advances through the iterators in parallel and returns the elements in order?
[1,3,5] + [2,8] => [1,2,3,5,8]

This would be a fun class to write, but I wouldn't want to reinvent the wheel.

A:

Iterators.mergeSorted in Guava is such a thing.

