title: Java 8: cast list of POJO to map - ID-POJO = map (Function<? super C, ?>) in Stream cannot be applied to (<lambda expression>, <lambda expression>)
body: <p>How fix this?</p>
  
  <p><strong>Error</strong></p>
  
  <p>map (Function)
  in Stream cannot be applied
  to (lambda expression>, lambda expression>)</p>
  
  <pre><code>static class C {
      int id;
  
      public int getId() {
          return id;
      }
  }
  
      Map&lt;Integer, C&gt; c = Arrays.asList(new C()).stream().collect(Collectors.toMap(c -&gt; c.getId(), c -&gt; c));
  </code></pre>