title: get list of ids from list of objects from inner list java 8
body: <p>I have list of entity class:</p>
  
  <pre><code>public class Entity
  {
      private long id;    
      private List&lt;InnerEnity&gt; data;
  
      public long getId() {
          return id;
      }
  
      public List&lt;InnerEnity&gt; getData() {
          return data;
      }
  }
  </code></pre>
  
  <p>this is InnerEnity class</p>
  
  <pre><code>public class InnerEnity 
  {
      private long id;    
      private String data;
  
      public long getId() {
          return id;
      }
  
      public String getData() {
          return data;
      }
  }
  </code></pre>
  
  <p>what i need is list of InnerEnity ids. 
  to resolve this i am trying something like that :-</p>
  
  <pre><code>List innerEnityIds = listOfEnity.stream().map(sys -&gt; sys.getData().stream().map(obj-&gt;obj.getId().collect(Collectors.toList())));
  </code></pre>