I don't understand how to change these null checks with Optional in a functional way:
private boolean findProduct(String prodName) {
for(OrderItem item : orderItems) {
if(item != null) {
Product p=item.getProduct();
if(p != null) {
String name = p.getProductName();
if(name != null) {
if(name.equals(prodName)) return true;
}
}
}
}
return false;
}