throw new ConcurrentModificationException();
throw new ConcurrentModificationException(knownMod + " != " + modCount);
    public Iterator iterator()    {      return new Iterator()      {        /**         * The entry that was returned by the last         * <code>next()</code> call.  This is also the entry whose         * bucket should be removed by the <code>remove</code> call. <br>         *         * It is null, if the <code>next</code> method wasn't         * called yet, or if the entry was already removed.  <br>         *         * Remembering this entry here will also prevent it from         * being removed under us, since the entry strongly refers         * to the key.         */        WeakBucket.WeakEntry lastEntry;        /**         * The entry that will be returned by the next         * <code>next()</code> call.  It is <code>null</code> if there         * is no further entry. <br>         *         * Remembering this entry here will also prevent it from         * being removed under us, since the entry strongly refers         * to the key.         */        WeakBucket.WeakEntry nextEntry = findNext(null);        /**         * The known number of modification to the list, if it differs         * from the real number, we throw an exception.         */        int knownMod = modCount;        /**         * Check the known number of modification to the number of         * modifications of the table.  If it differs from the real         * number, we throw an exception.         * @throws ConcurrentModificationException if the number         *         of modifications doesn't match.         */        private void checkMod()        {          // This method will get inlined.          cleanQueue();          if (knownMod != modCount)            throw new ConcurrentModificationException();        }        /**         * Get a strong reference to the next entry after         * lastBucket.         * @param lastEntry the previous bucket, or null if we should         * get the first entry.         * @return the next entry.         */        private WeakBucket.WeakEntry findNext(WeakBucket.WeakEntry lastEntry)        {          int slot;          WeakBucket nextBucket;          if (lastEntry != null)            {              nextBucket = lastEntry.getBucket().next;              slot = lastEntry.getBucket().slot;            }          else            {              nextBucket = buckets[0];              slot = 0;            }          while (true)            {              while (nextBucket != null)                {                  WeakBucket.WeakEntry entry = nextBucket.getEntry();                  if (entry != null)                    // This is the next entry.                    return entry;                  // Entry was cleared, try next.                  nextBucket = nextBucket.next;                }              slot++;              if (slot == buckets.length)                // No more buckets, we are through.                return null;              nextBucket = buckets[slot];            }        }        /**         * Checks if there are more entries.         * @return true, iff there are more elements.         * @throws ConcurrentModificationException if the hash map was         *         modified.         */        public boolean hasNext()        {          checkMod();          return nextEntry != null;        }        /**         * Returns the next entry.         * @return the next entry.         * @throws ConcurrentModificationException if the hash map was         *         modified.         * @throws NoSuchElementException if there is no entry.         */        public Object next()        {          checkMod();          if (nextEntry == null)            throw new NoSuchElementException();          lastEntry = nextEntry;          nextEntry = findNext(lastEntry);          return lastEntry;        }        /**         * Removes the last returned entry from this set.  This will         * also remove the bucket of the underlying weak hash map.         * @throws ConcurrentModificationException if the hash map was         *         modified.         * @throws IllegalStateException if <code>next()</code> was         *         never called or the element was already removed.         */        public void remove()        {          checkMod();          if (lastEntry == null)            throw new IllegalStateException();          modCount++;          internalRemove(lastEntry.getBucket());          lastEntry = null;          knownMod++;        }      };    }