Be even more efficient, also add another unittest

Re-use the existing iterator we already have, add a unittest to make
sure the second part of the method gets covered.