Call toStream first before map in EquaSet/SortedEquaSet's toArray and toBuffer implementation to preserve original order.