title: way to find the List of all ids in a list of entities from inner object with java 8
body: <p>I have an entity:</p>
  
  <pre><code>public class Entity
  {
      private long id;    
      private InnerEnity data;
  
      public long getId() {
          return id;
      }
  
      public InnerEnity getData() {
          return data;
      }
  }
  </code></pre>
  
  <p>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 tried something like that :- </p>
  
  <blockquote>
    <p>List innerEnityIds = listOfEnity.stream().map(sys -> sys.getData().stream().map(obj->obj.getId().collect(Collectors.toList())));</p>
  </blockquote>