Is there a specific aggregate operation to map superclasses to subclasses?
<p>Is there a specific aggregate operation to map superclasses to subclasses?</p>

<p>I frequently find myself doing operations such as:</p>

<pre><code>list
.stream()
.map((A element) -&gt; (SubClassA) element);
</code></pre>

<p>Is there an operation that does the equivalent of the <code>map</code> function above, that is, takes a <code>Stream</code> of values and casts them to a subclass?</p>