custom iterator with javav iterator interface