Skip to content

Commit 2b7e66a

Browse files
committed
renaming method according to content: thousand -> hundred
1 parent 438ff48 commit 2b7e66a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

java-streams/src/main/java/com/baeldung/stream/filter/Customer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)