title: Are there native JAVA collection classes that extend List that don't allow null elements?
body: <p>According to the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html#contains%28java.lang.Object%29" rel="nofollow noreferrer">documentation</a>, <code>List.contains</code> can throw <code>NullPointerException</code> in this scenario: </p>
  
  <blockquote>
    <p>"if the specified element is null and
    this list does not support null
    elements (optional)."</p>
  </blockquote>
  
  <p>I was just trying to think of a List implementation that doesn't allow nulls though, and I'm not aware of any.  For example, I can have <code>ArrayList&lt;Double&gt;</code>, but it allows nulls.</p>
  
  <pre><code>    List&lt;Double&gt; list = new ArrayList&lt;Double&gt;();
      if (list.contains(null)) { // this won't throw NPE            
      }
  </code></pre>
  
  <p>So is the documentation here referring to custom implementations of this interface, or are there some native JAVA collection classes that extend <code>List</code> that don't allow null elements? I realize the exception is optional, I was just trying to think of a real world case where this could occur.</p>