How can I convert the following for loop to use a Java lambda with streams?
List<Fruit> fruits = createFruitArrayList (); // creates a list of fruits
Fruit largeApple = null; // holds the largest apple so far for
for (Fruit fruit : fruits) {
if (fruit.getType () == “Apple”) {
if (largeApple == null ||
largeApple.size () < fruit.size ()) {
largeApple = fruit;
}
}
}