title: Why are calls to containsKey() failing for this groovy map?
body: <p>I imagine I'm screwing something up with these declarations, but I've got a groovy class with a field defined like this:</p>
  
  <pre><code>Map&lt;String, SomeType&gt; _someField = [:]
  </code></pre>
  
  <p>I do inserts like this:</p>
  
  <pre><code>_someField.put( someStringVariable, someTypeInstance )
  </code></pre>
  
  <p>...and then later, when I check whether a key I know has been mapped is present, the check fails:</p>
  
  <pre><code>_someField.containsKey( someStringVariable )
  </code></pre>
  
  <p>The only way I can get this to succeed is by calling <code>toString()</code>, like so:</p>
  
  <pre><code>_someField.containsKey( someStringVariable.toString() )
  </code></pre>
  
  <p>I'm using the generic declaration of the map so my IDE gives me auto completion on the value types, so I'd really like (I think) to keep the type information there.</p>
  
  <p>I've tried changing the key type from <code>String</code> to <code>GString</code>, but to no avail. I've tried changing the map initialization from the groovy shorthand <code>[:]</code> to <code>new LinkedHashMap&lt;&gt;</code>, also to no avail.</p>
  
  <p>Any ideas whether I can keep the type information and avoid having to use <code>toString()</code>?</p>