@@ -9,26 +9,26 @@ public static void main(String ... args){
99
1010 List <Apple > inventory = Arrays .asList (new Apple (80 ,"green" ),
1111 new Apple (155 , "green" ),
12- new Apple (120 , "red" ));
12+ new Apple (120 , "red" ));
1313
1414 // [Apple{color='green', weight=80}, Apple{color='green', weight=155}]
1515 List <Apple > greenApples = filterApples (inventory , FilteringApples ::isGreenApple );
1616 System .out .println (greenApples );
17-
17+
1818 // [Apple{color='green', weight=155}]
1919 List <Apple > heavyApples = filterApples (inventory , FilteringApples ::isHeavyApple );
2020 System .out .println (heavyApples );
21-
21+
2222 // [Apple{color='green', weight=80}, Apple{color='green', weight=155}]
2323 List <Apple > greenApples2 = filterApples (inventory , (Apple a ) -> "green" .equals (a .getColor ()));
2424 System .out .println (greenApples2 );
25-
25+
2626 // [Apple{color='green', weight=155}]
2727 List <Apple > heavyApples2 = filterApples (inventory , (Apple a ) -> a .getWeight () > 150 );
2828 System .out .println (heavyApples2 );
29-
29+
3030 // []
31- List <Apple > weirdApples = filterApples (inventory , (Apple a ) -> a .getWeight () < 80 ||
31+ List <Apple > weirdApples = filterApples (inventory , (Apple a ) -> a .getWeight () < 80 ||
3232 "brown" .equals (a .getColor ()));
3333 System .out .println (weirdApples );
3434 }
@@ -54,7 +54,7 @@ public static List<Apple> filterHeavyApples(List<Apple> inventory){
5454 }
5555
5656 public static boolean isGreenApple (Apple apple ) {
57- return "green" .equals (apple .getColor ());
57+ return "green" .equals (apple .getColor ());
5858 }
5959
6060 public static boolean isHeavyApple (Apple apple ) {
@@ -69,7 +69,7 @@ public static List<Apple> filterApples(List<Apple> inventory, Predicate<Apple> p
6969 }
7070 }
7171 return result ;
72- }
72+ }
7373
7474 public static class Apple {
7575 private int weight = 0 ;
0 commit comments