I would like to write the code below using Stream, instead of with a for loop
private Car getCar(String CarRef, List<Car> cars) {
for (Car car : cars) {
if (carRef.equals(car.getName())) {
return car;
}
}
return null;
}