public class IteratorDriver {

    // List out the names in the NameRepopsitory Class and
    // then list out the person's favorite book from the Book Repository
    public static void main(String[] args){

        NameRepository nameRepository = new NameRepository();
        BookRepository bookRepository = new BookRepository();
        bookRepository.createBookHash();

        for(Iterator iterator = nameRepository.getIterator();  iterator.hasNext();){
            String name = (String)iterator.next();
            System.out.print(name + ": ");

            for(Iterator iterator1 = bookRepository.getIterator(); iterator1.hasNext();){
                if(name.equals(iterator1.next())){
                    System.out.println(bookRepository.bookHash.get(name));
                }
            }
        }
    }
}
