Hard limit/upper bound on number of keys in HashMap java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5601333/limiting-the-max-size-of-a-hashmap-in-java">Limiting the max size of a HashMap in Java</a>  </p>
</blockquote>



<p>How do you make sure HashMap in java doesn't get rehashed when number of keys exceeds capacity. I want to limit number of keys stored in hashmap (extra keys should be evicted based on default eviction policy of hashmap, but hashmap should not get rehashed/increase in capacity)</p>
