title: Java 8: extract a substream from a stream
body: <p>I have a stream of Objects, from which I need to extract a Stream which has only some of the object attributes.</p>
  
  <p>For example, from a <code>Stream&lt;Car&gt;</code>, I need to extract a <code>Stream&lt;CarDetails&gt;</code>.</p>
  
  <pre><code>Car {
     String name;
     String model;
     Engine e;
     CarType t;
     ...
  }
  </code></pre>
  
  <p>I want to extract a <code>Stream</code> of objects having type <code>CarDetails</code>:</p>
  
  <pre><code>CarDetails {
     String name;
     String model;
  }
  </code></pre>