Question is how much it costs to create an ArrayList from a HashMap.values() Collection? Or creating the values Collection alone? Assuming Map.size() > 100k. Objects could also
You can use an Iterator to skip elements - just call next() many times.
Iterator
next()
Creating a list of any collection has a linear complexity.