How to use a Java 8 Lambda expression to convert a List of one type to a List of its subtype

Viewed 9702

I can only seem to find how to do this in C# not Java.

I have a List<TypeX> but I know that every single element in that list is actually a subclass of TypeX Called TypeY.

How can I write a Lambda expression that accepts List<TypeX> and returns List<TypeY>?

4 Answers
Related