add helper callGetIteratorRange

It is a simple helper function that given an iterator and the index at
which the iterator is return a range of element