renaming method according to content: thousand -> hundred
This commit is contained in:
parent
438ff48c27
commit
2b7e66a398
|
@ -32,7 +32,7 @@ public class Customer {
|
|||
return this.points > points;
|
||||
}
|
||||
|
||||
public boolean hasOverThousandPoints() {
|
||||
public boolean hasOverHundredPoints() {
|
||||
return this.points > 100;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public class StreamCountUnitTest {
|
|||
public void givenListOfCustomers_whenUsingMethodOverHundredPointsAndCount_thenGetTwo() {
|
||||
long count = customers
|
||||
.stream()
|
||||
.filter(Customer::hasOverThousandPoints)
|
||||
.filter(Customer::hasOverHundredPoints)
|
||||
.count();
|
||||
|
||||
assertThat(count).isEqualTo(2L);
|
||||
|
|
|
@ -62,7 +62,7 @@ public class StreamFilterUnitTest {
|
|||
|
||||
List<Customer> customersWithMoreThan100Points = customers
|
||||
.stream()
|
||||
.filter(Customer::hasOverThousandPoints)
|
||||
.filter(Customer::hasOverHundredPoints)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
assertThat(customersWithMoreThan100Points).hasSize(2);
|
||||
|
@ -81,7 +81,7 @@ public class StreamFilterUnitTest {
|
|||
.flatMap(c -> c
|
||||
.map(Stream::of)
|
||||
.orElseGet(Stream::empty))
|
||||
.filter(Customer::hasOverThousandPoints)
|
||||
.filter(Customer::hasOverHundredPoints)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
assertThat(customersWithMoreThan100Points).hasSize(2);
|
||||
|
|
Loading…
Reference in New Issue