I have a method that works fine. This is how it looks.
private ArrayList<Car> carsInStore ; //in car class have setter/getter/quals/Constructor.
public boolean checkIfcarInStore(Car c) {
for (Car car : carsInStore) {
if(car.equals(c)){
return true;
}
}
}
I want to switch this to Lambda.
But I am not sure how fill in the if (condition) return true or return false outside.
And I know I can do it in stream too. Can anyone give an example?