title: Converting list of objects with map to array of primitives
body: <p>I keep finding pieces of something I need to do, but I'm having trouble putting it all together. To start, here is my object, put simply:</p>
  
  <pre><code>Object1
      Object2
          Map&lt;String, Double&gt;
  </code></pre>
  
  <p>What I need to do is, starting with a list of <code>Object1</code>, get a <code>double[]</code> for the values of the map given a specific key (all Objects in the list have the same N keys in the map).</p>
  
  <p>Here was my starting attempt:</p>
  
  <pre><code>myList.stream().map(Object1::getObject2).map(Object2::getMyMap).map(m -&gt; m.get(key).collect(Collectors.toCollection(ArrayList::new))
  </code></pre>
  
  <p>I'm not sure how to get to the primitive array from here. If this is good so far, where do I go from here? If there a better way to do this whole thing, I'm open to suggestions. Any help is appreciated, thank you.</p>