title: adding to an empty list
body: <p>When I execute the below code it works without any problem.</p>
  
  <pre><code>List&lt;String&gt; singletonList = Collections.singletonList("Hello");
  List&lt;String&gt; s = Collections.emptyList();
  singletonList.addAll(s);
  </code></pre>
  
  <p>However, when I try to do following it gives me compile error. Why?</p>
  
  <pre><code>List&lt;String&gt; singletonList = Collections.singletonList("Hello");
  singletonList.addAll(List&lt;String&gt; Collections.emptyList());
  </code></pre>
  
  <p>Collections.emptyList is a type-safe way of creating an empty list. But why doesn't my program compile then? I know I cannot add to immutable list (<code>UnsupportedOperationException</code>) but adding an empty list is allowed. Actually I was testing this and I noticed above thing.</p>