title: HashMap Java get value if it exists
body: <p>I wish to get a value from a HasMap but some time the value doesn't exist so I have done this:</p>
  
  <pre><code>int var = 0;
  if (hashMapHouse.containsKey("home1") {
      var = hashMapHouse.get("houme1");
  }
  if(var==0) //do something
  else //do something else
  </code></pre>
  
  <p>My question is: is it possible to have one call of hashMap in order to get the value and to test if the value exist or no?</p>