title: Is there an equivalent of Javascript's Array.map in Java 8?
body: <p>Is there an equivalent of Javascript's <code>Array.map</code> in Java?</p>
  
  <p>I have been playing with Java 8 : </p>
  
  <pre><code>List&lt;Long&gt; roleList = siteServiceList.stream()
          .map(s -&gt; s.getRoleIdList()).collect(Collectors.toList());
  </code></pre>
  
  <p>but this doesn't work I don't know why the warning says <code>Incompatible Type</code>. </p>
  
  <p>How can I do this in Java8?</p>