for(Iterator i = deliveries.values().iterator(); i.hasNext(); )
for(Iterator i = deliveries.iterator(); i.hasNext(); )
   public List delivering(Filter filter)   {      List delivering = new ArrayList();      synchronized (deliveries)      {         for(Iterator i = deliveries.values().iterator(); i.hasNext(); )         {            Delivery d = (Delivery)i.next();            MessageReference r = d.getReference();            // TODO: I need to dereference the message each time I apply the filter. Refactor so the message reference will also contain JMS properties            if (filter == null || filter.accept(r.getMessage()))            {               delivering.add(r);            }         }      }      if (log.isTraceEnabled()) {  log.trace(this + ": the non-recoverable state has " + delivering.size() + " messages being delivered"); }      return delivering;   }