Any Java Map implementations that allow for conditional insertion similar to STL map::insert?
<p>I would like to insert a key-value pair into a Map only if the key is not already present, otherwise I would like to retrieve the existing value without replacing it. I can do this with a get(), followed by a conditional put(). However this requires resolving the location of the key in the Map twice (2 hashes, 2 tree traversals, etc depending on the map implementation) which seems unnecessary. Do any of the standard Map implementations allow this operation to be condensed, similar to how map::insert works in the C++ STL?</p>
