title: Is it possible to cast a Stream in Java 8?
body: <p>Is it possible to cast a stream in Java 8? Say I have a list of objects, I can do something like this to filter out all the additional objects:</p>
  
  <pre><code>Stream.of(objects).filter(c -&gt; c instanceof Client)
  </code></pre>
  
  <p>After this though, if I want to do something with the clients I would need to cast each of them:</p>
  
  <pre><code>Stream.of(objects).filter(c -&gt; c instanceof Client)
      .map(c -&gt; ((Client) c).getID()).forEach(System.out::println);
  </code></pre>
  
  <p>This looks a little ugly. Is it possible to cast an entire stream to a different type? Like cast <code>Stream&lt;Object&gt;</code> to a <code>Stream&lt;Client&gt;</code>?</p>
  
  <p>Please ignore the fact that doing things like this would probably mean bad design. We do stuff like this in my computer science class, so I was looking into the new features of java 8 and was curious if this was possible.</p>