It's worse than that, what happens if some of the set gets evicted by the end?  This method seems ill-specified.