Mmm... So we have a case where we transform: ```Iterator<Record> ```-->  ```Iterator<VALUEIN>``` AND we need the key of the ```Record``` object just once. There are some approaches much more general than instantiating a specific implementation of an ```Iterable``` (here, an ```ArrayList```), mostly ```IteratorUtils``` in apache commons or guava....

Both made the code much less readable (and slower), so I tried to keep it KISS for now.

Moreover, I suspect that when we wrap secondary sorting this code will change