I have a current ArrayList of type A and I want to create a new list of all the object in this list that is of type B where B is a sub-class of A. Is there a way to do this using a map()?
ArrayList<B> allBs = allAs.stream().map( b -> where b instanceof B)
That would maybe look something like this?