Iterator<V> () { return new Iterator<V>() { private final Iterator<Collection<V>> mapIterator = myMap.values().iterator(); private Iterator<V> itr = Collections.emptyIterator(); @Override public boolean hasNext() { do { if (itr.hasNext()) return true; if (!mapIterator.hasNext()) return false; itr = mapIterator.next().iterator(); } while (true); } @Override public V next() { do { if (itr.hasNext()) return itr.next(); if (!mapIterator.hasNext()) throw new NoSuchElementException(); itr = mapIterator.next().iterator(); } while (true); } @Override public void remove() { itr.remove(); } }; }