title: null-safe Collection contains method
body: <p>What's the best way to do null-safe <code>contains</code> on a Java collection?  </p>
  
  <p>in other words - </p>
  
  <pre><code> if (collection != null &amp;&amp; collection.contains(x))
  </code></pre>
  
  <p>?</p>
  
  <p>I was hoping Apache commons-collections had something like <code>CollectionUtils.contains(collection, x)</code> that would simply return false if the collection was null, as there is with <code>size()</code>, which treats null like an empty collection.</p>
  
  <p>However, it seems like there is no such thing - did I just miss it?</p>