}
public void testIterationWithAddition2() {
List<Message> msgs=createMessages();
MessageBatch batch=new MessageBatch(msgs);
int count=0;
for(Iterator<Message> it=batch.iterator(); it.hasNext();) {
it.next();
count++;
if(count % 2 == 0)
batch.add(new Message());
}
System.out.println("batch = " + batch);
assert count == msgs.size() : "the added messages should *not* have been included";