I have a list of objects List<Car> cars
public class Car{
String make;
String model;
String year;
String price;
}
I want a succinct way of converting this list to a map Map<String, List<Car>>
using make as the key. I could write a function to do that but I was wondering if Lambdas or stream api in Java 8 provides an out of the box way to achieve this.
I have modified the question for a Map<String, List<Car>>