return new AbstractMap.BasicMapEntry<K, V>(enumClass.getEnumConstants()[index],
return new AbstractMap.SimpleEntry<K, V>(enumClass.getEnumConstants()[index],
  public Set<Map.Entry<K, V>> entrySet()  {    if (entries == null)      {	entries = new AbstractSet<Map.Entry<K, V>>()	{	  public int size()	  {	    return cardinality;	  }	  public Iterator<Map.Entry<K, V>> iterator()	  {	    return new Iterator<Map.Entry<K, V>>()	    {	      int count = 0;	      int index = -1;	      public boolean hasNext()	      {		return count < cardinality;	      }	      public Map.Entry<K,V> next()	      {		++count;		for (++index; store[index] == emptySlot; ++index)		  ;		// FIXME: we could just return something that		// only knows the index.  That would be cleaner.		return new AbstractMap.BasicMapEntry<K, V>(enumClass.getEnumConstants()[index],							   store[index])		{		  public V setValue(V newVal)		  {		    value = newVal;		    return put(key, newVal);		  }		};	      }	      public void remove()	      {		--cardinality;		store[index] = (V) emptySlot;	      }	    };	  }	  public void clear()	  {	    EnumMap.this.clear();	  }	  public boolean contains(Object o)	  {	    if (! (o instanceof Map.Entry))	      return false;	    Map.Entry<K, V> other = (Map.Entry<K, V>) o;	    return (containsKey(other.getKey())		    && AbstractCollection.equals(get(other.getKey()),						 other.getValue()));	  }	  public boolean remove(Object o)	  {	    if (! (o instanceof Map.Entry))	      return false;	    Map.Entry<K, V> other = (Map.Entry<K, V>) o;	    return EnumMap.this.remove(other.getKey()) != null;	  }	};      }    return entries;  }