@@ -0,0 +1,1415 @@
+package com.dp;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0Aimport java.util.NoSuchElementException;%0A%0A/**%0A *%0A * @author Anil Jaglan%0A */%0Apublic class IterativeDesignPattern%3CE%3E %7B%0A%0A    private List%3CE%3E list = new ArrayList%3CE%3E();%0A    private int size = 0;%0A%0A    public class Iterator implements java.util.Iterator%3CE%3E %7B%0A%0A        private IterativeDesignPattern idp;%0A        private java.util.Iterator itr;%0A        private E current;%0A        private int cursor;%0A        private int lastRet = -1;%0A%0A        public Iterator(IterativeDesignPattern idp) %7B%0A            this.idp = idp;%0A            itr = list.iterator();%0A            cursor = 0;%0A            lastRet = -1;%0A        %7D%0A%0A        @Override%0A        public E next() %7B%0A            try %7B%0A                lastRet = cursor;%0A                current = (E) itr.next();%0A                cursor++;%0A            %7D catch (NoSuchElementException ex) %7B%0A                current = null;%0A                throw ex;%0A            %7D%0A            return current;%0A        %7D%0A%0A        @Override%0A        public boolean hasNext() %7B%0A            return cursor != size;%0A        %7D%0A%0A        @Override%0A        public void remove() %7B%0A            throw new UnsupportedOperationException(%22Not supported yet.%22);%0A        %7D%0A    %7D%0A%0A    public void add(E in) %7B%0A        list.add(in);%0A        size++;%0A    %7D%0A%0A    public Iterator iterator() %7B%0A        return new Iterator(this);%0A    %7D%0A%7D%0A

Create IteratorDesignPattern.java