title: Java 8 Incompatible Types Error
body: <pre><code>Set&lt;Object&gt; removedObjs = new HashSet&lt;&gt;();
  List&lt;? extends MyEntity&gt; delObjs = (List&lt;? extends MyEntity&gt;) new ArrayList&lt;&gt;(removedObjs);
  </code></pre>
  
  <p><code>MyEntity</code> is marker interface.</p>
  
  <p>Above code is working fine in <a href="/questions/tagged/java-7" class="post-tag" title="show questions tagged &#39;java-7&#39;" rel="tag">java-7</a>(java version "1.7.0_91", to be precise) but not in <a href="/questions/tagged/java-8" class="post-tag" title="show questions tagged &#39;java-8&#39;" rel="tag">java-8</a>(java version "1.8.0_77")</p>
  
  <p>In Java8, I am getting the following exception:</p>
  
  <blockquote>
    <p><code>incompatible types: ArrayList&lt;Object&gt; cannot be converted to List&lt; ? extends MyEntity&gt;</code></p>
  </blockquote>