Guidewire interview question

Design custom Iterator with hasNext() and Next() for a specific custom class