title: copy one arraylist to another arraylist in kotlin
body: <p>I am trying to copy one <code>ArrayList</code> to another <code>ArrayList</code> in Kotlin</p>
  
  <p>1st <code>ArrayList</code>:</p>
  
  <pre><code>private var leadList1: ArrayList&lt;Lead&gt; = ArrayList()
  </code></pre>
  
  <p>2nd <code>ArrayList</code>:</p>
  
  <pre><code>val leadList2: ArrayList&lt;Lead?&gt;?
  </code></pre>
  
  <p>I tried to use <code>addAll()</code>. <code>leadList1.addAll(leadList2)</code></p>
  
  <p>But its not working.</p>
  
  <p>Error showing:</p>
  
  <pre><code>Required: Collection&lt;Lead&gt;
  Found: kotlin.collections.ArrayList&lt;Lead?&gt;?
  </code></pre>