Can a get() ever be null after a containsKey() check in a Hashtable? : <p>I've implemented a Hashtable in an android application which is initially populated in the following way:</p>

<pre><code>if(table.containsKey(key)){
    table.get(key).add(item);
}else{
    table.put(key, new ArrayList&lt;Items&gt;());
    table.get(key).add(item);
}
</code></pre>

<p>(variable names changed slightly)</p>

<p>Android Studio gives a <code>Method invocation 'add' may produce NullPointerException</code> warning on on both add methods. My previous (and only) experience of dict-type structures comes from Python and this was never an issue, but for safety's sake I'd like to check: is it actually possible for this to ever throw a NPE?</p>

<p>Cheers</p>
