title: Java generics incompatible types (no instance(s) of type variable(s) exist)
body: <p>The question title may seem to be same as some other post but the content is different. So please don't mark it duplicate.</p>
  <p><strong>Problem</strong>:</p>
  <p>I have the below class:</p>
  <pre><code>public class SCDTO extends RDTO {
      private List&lt;String&gt; sCPairs = Collections.emptyList();
  
      public SCDTO(List&lt;String&gt; sCPairs) {
          this.sCPairs = sCPairs;
      }
  
      //Getter setter
      
  }
  </code></pre>
  <p>I am trying to using the below lambda expression to set the <code>sCPairs</code>.</p>
  <pre><code>sCPairsObject.setSCPairs(
           util.getSCMap().entrySet().stream()
          .filter(entry -&gt; entry.getValue().contains(&quot;abc&quot;))
          .collect(Collectors.toCollection(ArrayList&lt;String&gt;::new))
  );
  </code></pre>
  <p>But I have an compilation error saying:</p>
  <pre><code>no instance(s) of type variable(s) exist so that Entry&lt;String, List&lt;String&gt;&gt; conforms to String
  </code></pre>
  <p><code>util.getSCMap</code> returns <code>Map&lt;String, List&lt;String&gt;&gt;</code>.</p>
  <p>Can anyone please explain why this is happening and how to solve it?</p>
  <p>Thanks.</p>