/*
(non-Javadoc)
This implementation is thread safe because it makes a copy of the set under synchronized locks under the subMaps.

@see java.util.Map#entrySet()
194105
public java.util.Set entrySet()
    {
        java.util.Set combinedSet = new java.util.HashSet();
        if (subMaps != null) {
            for (int i = 0; i < subMaps.length; i++) {
                synchronized (subMaps[i]) {
                    combinedSet.addAll(subMaps[i].entrySet());
                } // synchronized (subMap).
            }
        }
        return combinedSet;

    }
588963
@Override
    public Iterator<Map.Entry<String, PrefabValueFactory<?>>> iterator() {
        return cache.entrySet().iterator();
    }
909658
public static <K, V> EntryStream<K, V> of(Map<K, V> map) {
        return of(map.entrySet().stream());
    }
1137884
@Override
    public Entry<K, V> floorEntry(K key)
    {
        Entry<K, V> entry = entry(key, null);
        return entrySet.floor(entry);
    }
472895
public void setEntries(Map<String, String> entries) {

        String[][] entriesArray = null;
        if ((entries != null) && !entries.isEmpty()) {
            entriesArray = new String[entries.size()][];
            int i = 0;
            for (Entry<String, String> entry : entries.entrySet()) {
                entriesArray[i] = new String[] {entry.getKey(), entry.getValue()};
                i++;
            }
        }

        getState().setEntries(entriesArray);
    }
356371
public ListInventoryEntriesResult withEntries(java.util.Collection<java.util.Map<String, String>> entries) {
        setEntries(entries);
        return this;
    }
783948
@Override public ImmutableSet<Entry<K, V>> entries() {
    ImmutableSet<Entry<K, V>> result = entries;
    return (result == null)
        ? (entries = new EntrySet<K, V>(this))
        : result;
  }
647740
@Override
    public void storeAll(Map mapEntries) {
        int batchSize = getBatchSize();
        if (batchSize == 0 || mapEntries.size() < batchSize) {
            storeBatch(mapEntries);
        }
        else {
            Map batch = new HashMap(batchSize);

            while (!mapEntries.isEmpty()) {
                Iterator iter = mapEntries.entrySet().iterator();
                while (iter.hasNext() && batch.size() < batchSize) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    batch.put(entry.getKey(), entry.getValue());
                }

                storeBatch(batch);

                mapEntries.keySet().removeAll(batch.keySet());
                batch.clear();
            }
        }
    }
985313
public K getCurrentKey()
    {
        lock.lock();
        try
        {
            Thread currentThread = Thread.currentThread();
            for (Entry<K,Thread> entry : threadMap.entrySet())
            {
                if (currentThread.equals(entry.getValue()))
                {
                    return entry.getKey();
                }
            }
            return null;
        }
        finally
        {
            lock.unlock();
        }
    }
1372053
@Override
	public Iterator<Map.Entry<K, V>> iterator() {
		return Collections.unmodifiableSet(state.entrySet()).iterator();
	}
103081
public static <K, V> Map.Entry<K, V> immutableEntry(Map.Entry<K, V> entry) {
      return new ImmutableEntry<>(entry);
   }
790696
@SuppressWarnings({ "unchecked", "cast" })
    @Override
    public Set<Map.Entry<K, V>> entrySet() {
        return isEmpty() ? Collections.<Map.Entry<K, V>> emptySet() : super.entrySet();
    }
326150
public Set<Entry<K, V>> entrySet() {
        TreeSet<Entry<K,V>> set = new TreeSet<Entry<K,V>>();
        
        synchronized( this ) {
            for(K key : keySet() ) {
                if( containsKey(key) ) {
                    get(key);
                    set.add(getEntry(key));
                }
            }
            return set;
        }
    }
733613
protected Set<E> set() {
    return elements.entrySet()
        .stream()
        .filter(entry -> !entry.getValue().isTombstone())
        .map(entry -> decode(entry.getKey()))
        .collect(Collectors.toSet());
  }
236141
@Override
  public Set<Entry<K, Collection<V>>> entrySet() {
    return new AbstractSet<Entry<K, Collection<V>>>() {
      @Override
      public Iterator<Map.Entry<K, Collection<V>>> iterator() {
        Filter<Map.Entry<K, Collection<V>>> filter1 = new Filter<Map.Entry<K, Collection<V>>>() {
          private static final long serialVersionUID = -3257173354412718639L;

          // only accepts stuff not overwritten by deltaMap
          public boolean accept(Map.Entry<K, Collection<V>> e) {
            K key = e.getKey();
            if (deltaMap.containsKey(key)) {
              return false;
            }
            return true;
          }
        };

        Iterator<Map.Entry<K, Collection<V>>> iter1 = new FilteredIterator<Map.Entry<K, Collection<V>>>(originalMap.entrySet().iterator(), filter1);

        Filter<Map.Entry<K, Collection<V>>> filter2 = new Filter<Map.Entry<K, Collection<V>>>() {
          private static final long serialVersionUID = 1L;

          // only accepts stuff not overwritten by deltaMap
          public boolean accept(Map.Entry<K, Collection<V>> e) {
            if (e.getValue() == removedValue) {
              return false;
            }
            return true;
          }
        };


        Iterator<Map.Entry<K, Collection<V>>> iter2 = new FilteredIterator<Map.Entry<K, Collection<V>>>(deltaMap.entrySet().iterator(), filter2);

        return new ConcatenationIterator<Map.Entry<K, Collection<V>>>(iter1, iter2);
      }

      @Override
      public int size() {
        int size = 0;
        for (// @SuppressWarnings("unused")  // this makes javac v1.5 barf!!
             Entry<K, Collection<V>> entry : this) {
          ErasureUtils.noop(entry);
          size++;
        }
        return size;
      }
    };
  }
1122769
private Entry<K, V> getEntry(K key) {
        final K k = key;
        
        return new Entry<K, V>() {
            public boolean equals(Object ob) {
                if( ob instanceof Entry ) {
                    Entry entry = (Entry)ob;
                    
                    if( !entry.getKey().equals(getKey()) ) {
                        return false;
                    }
                    if( !entry.getValue().equals(getValue()) ) {
                        return false;
                    }
                    return true;
                }
                return false;
            }

            public K getKey() {
                return k;
            }

            public V getValue() {
                return ConcurrentCache.this.get(getKey());
            }

            public V setValue(V val) {
                return ConcurrentCache.this.put(getKey(), val);
            }
        };
    }
1344969
public void putAll(Map m)
    {
        Iterator i = m.entrySet().iterator();
        boolean multi=m instanceof MultiMap;
        while(i.hasNext())
        {
            Map.Entry entry =
                (Map.Entry)i.next();
            if (multi)
                super.put(entry.getKey(),LazyList.clone(entry.getValue()));
            else
                put(entry.getKey(),entry.getValue());
        }
    }