title: Return Value of put() in HashMap
body: <p>I was having trouble understanding the explanation for return value of <code>put()</code> in a <code>HashMap</code>:</p>
  
  <pre><code>  private Map&lt;Bookmark, Integer&gt; mDevice = new HashMap&lt;String, Integer&gt;();
  
      String abc = "two"
      Integer ret = mDevice.put(abc, ONLINE);
  </code></pre>
  
  <p>Am I correct in saying the following: </p>
  
  <ol>
  <li>if abc key already exists with value <code>OFFLINE</code>, ret is equal to <code>OFFLINE</code>.</li>
  <li>if abc key already exists with value <code>ONLINE</code>, ret is equal to <code>ONLINE</code>.</li>
  <li>if abc key did not exist, then ret is equal to <code>null</code>.</li>
  </ol>