title: Best way to check collections not null & null conditions
body: <p>we use collections like ArrayList,hashmap &amp; many more.</p>
  
  <p>Number of times we have check condition like whether list is null or not.</p>
  
  <p>We have many ways to chek whether our collection is  null or not.</p>
  
  <p>Different ways.</p>
  
  <pre><code>1. if(list==null)
  2. if(list.size()==0)
  3. if(list.isEmpty())
  </code></pre>
  
  <p>Also sometimes we also need to check whether list is not null , so we normally check it by these ways</p>
  
  <pre><code>1. if(list!=null)
  2. if(list.size()&gt;0)
  3. if(!list.isEmpty()) 
  </code></pre>
  
  <blockquote>
    <p>Which is best condition  or do we need to make some combination of
    these considering performance of program execution?</p>
  </blockquote>