File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
main/java/com/baeldung/stream/filter
test/java/com/baeldung/stream/filter Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public boolean hasOver(int points) {
3232 return this .points > points ;
3333 }
3434
35- public boolean hasOverThousandPoints () {
35+ public boolean hasOverHundredPoints () {
3636 return this .points > 100 ;
3737 }
3838
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public void givenListOfCustomers_whenNoneMatchesFilterAndCount_thenGetZero() {
6464 public void givenListOfCustomers_whenUsingMethodOverHundredPointsAndCount_thenGetTwo () {
6565 long count = customers
6666 .stream ()
67- .filter (Customer ::hasOverThousandPoints )
67+ .filter (Customer ::hasOverHundredPoints )
6868 .count ();
6969
7070 assertThat (count ).isEqualTo (2L );
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public void givenListOfCustomers_whenFilterByMethodReference_thenGetTwo() {
6262
6363 List <Customer > customersWithMoreThan100Points = customers
6464 .stream ()
65- .filter (Customer ::hasOverThousandPoints )
65+ .filter (Customer ::hasOverHundredPoints )
6666 .collect (Collectors .toList ());
6767
6868 assertThat (customersWithMoreThan100Points ).hasSize (2 );
@@ -81,7 +81,7 @@ public void givenListOfCustomersWithOptional_whenFilterBy100Points_thenGetTwo()
8181 .flatMap (c -> c
8282 .map (Stream ::of )
8383 .orElseGet (Stream ::empty ))
84- .filter (Customer ::hasOverThousandPoints )
84+ .filter (Customer ::hasOverHundredPoints )
8585 .collect (Collectors .toList ());
8686
8787 assertThat (customersWithMoreThan100Points ).hasSize (2 );
You can’t perform that action at this time.
0 commit comments