Here is my code:
public class CarShop {
private final HashMap<Brand, List<CarPrototype>> catalog;
public List<CarPrototype> allPrototypes() {
List<CarPrototype> prototypes = catalog.values().stream().collect(Collectors.toList())
return prototypes ;
}
What I want to do in this method is I want to get a list of all different car prototypes given in car shop catalog. I should not use for loop, so stream comes into play. My solution is adds only lists of prototypes, and I struggle finding how to change it so it add specific prototypes themselves.