package org.xander.behavioral.iterator;

import java.util.ArrayList;
import java.util.Iterator;

public class Waitress {
    ArrayList menus;

    public Waitress(ArrayList menus) {
        this.menus = menus;
    }

    public void printMenu() {
        Iterator menuIterator = menus.iterator();
        while (menuIterator.hasNext()) {
            Menu menu = (Menu) menuIterator.next();
            System.out.println();
            printMenu(menu.createIterator());
        }
    }

    private void printMenu(Iterator iterator) {
        while (iterator.hasNext()) {
            MenuItem menuItem = (MenuItem) iterator.next();
            System.out.print(menuItem.getName() + ", ");
            System.out.print(menuItem.getPrice() + " -- ");
            System.out.println(menuItem.getDescription());
        }
    }
}

@@ -123,24 +123,30 @@
    ArrayList
+%3CMenu%3E
  menus;%0A%0A   
@@ -171,16 +171,22 @@
 rrayList
+%3CMenu%3E
  menus) 
@@ -268,16 +268,22 @@
 Iterator
+%3CMenu%3E
  menuIte
@@ -376,15 +376,8 @@
 nu =
- (Menu)
  men
@@ -526,16 +526,26 @@
 Iterator
+%3CMenuItem%3E
  iterato
@@ -621,19 +621,8 @@
 em =
- (MenuItem)
  ite

Update Waitress.java