public static void Run() { var history = new BrowserHistory(); history.Push("www.google.com"); history.Push("www.amazon.com"); history.Push("www.bing.com"); var iterator = history.CreateIterator(); while (iterator.HasNext()) { var url = iterator.Current(); Console.WriteLine(url); iterator.Next(); } }
public ListIterator(BrowserHistory history) => this.history = history;