title: What is difference between isEmpty() and size() for hashmap if used under if condition?
body: <p>I have to deal with <code>NullPointerException</code> which is occurring on <code>Hashmap</code>. Shall I use <code>map.isEmpty()</code> or (<code>map.size() &gt; 0</code>) inside <code>if</code> condition?</p>
  
  <p>Which one is better?</p>