title: Using Java lambdas or streams to convert list of POJOs into a list of their IDs
body: <p>I'm trying to broaden my Java horizons and start actually writing Java 8+ code. I have a situation where I have a list of POJOs (each POJO instancehas an <code>id : Long</code> field) and I need to produce a <code>List&lt;Long&gt;</code> representing all of their <code>ids</code>. Here's my code that works perfectly fine:</p>
  
  <pre><code>List&lt;Fizzbuzz&gt; fizzbuzzes = getFizzbuzzes();
  List&lt;Long&gt; fbIds = new ArrayList&lt;&gt;();
  for(Fizzbuzz fb : fizzbuzzes) {
      fbIds.add(fb.getId());
  }
  </code></pre>
  
  <p>I'm wondering if there's a more "modern" Java 8+ way (lambdas or collections tricks, streaming, etc.) to write this code. Any ideas or is this as good as it gets?</p>