for (Iterator i = cache.all() ; i.hasNext() ;) {
for (Iterator i = cache.iterator() ; i.hasNext() ;) {
    public void addServiceListener(String type, ServiceListener listener) {        String lotype = type.toLowerCase();        removeServiceListener(lotype, listener);        LinkedList list = (LinkedList) serviceListeners.get(lotype);        if (list == null) {            list = new LinkedList();            serviceListeners.put(lotype, list);        }        list.add(listener);                // report cached service types        for (Iterator i = cache.all() ; i.hasNext() ;) {            for (DNSCache.CacheNode n = (DNSCache.CacheNode) i.next(); n != null; n = n.next()) {                DNSRecord rec = (DNSRecord) n.getValue();                if (rec.type == DNSConstants.TYPE_SRV) {                    if (rec.name.endsWith(type)) {                        listener.serviceAdded(new ServiceEvent(this, type, toUnqualifiedName(type, rec.name), null));                    }                }            }        }        new ServiceResolver(type).start();    }