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;
|
return this.points > points;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasOverThousandPoints() {
|
public boolean hasOverHundredPoints() {
|
||||||
return this.points > 100;
|
return this.points > 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class StreamCountUnitTest {
|
||||||
public void givenListOfCustomers_whenUsingMethodOverHundredPointsAndCount_thenGetTwo() {
|
public void givenListOfCustomers_whenUsingMethodOverHundredPointsAndCount_thenGetTwo() {
|
||||||
long count = customers
|
long count = customers
|
||||||
.stream()
|
.stream()
|
||||||
.filter(Customer::hasOverThousandPoints)
|
.filter(Customer::hasOverHundredPoints)
|
||||||
.count();
|
.count();
|
||||||
|
|
||||||
assertThat(count).isEqualTo(2L);
|
assertThat(count).isEqualTo(2L);
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class StreamFilterUnitTest {
|
||||||
|
|
||||||
List<Customer> customersWithMoreThan100Points = customers
|
List<Customer> customersWithMoreThan100Points = customers
|
||||||
.stream()
|
.stream()
|
||||||
.filter(Customer::hasOverThousandPoints)
|
.filter(Customer::hasOverHundredPoints)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
assertThat(customersWithMoreThan100Points).hasSize(2);
|
assertThat(customersWithMoreThan100Points).hasSize(2);
|
||||||
|
@ -81,7 +81,7 @@ public class StreamFilterUnitTest {
|
||||||
.flatMap(c -> c
|
.flatMap(c -> c
|
||||||
.map(Stream::of)
|
.map(Stream::of)
|
||||||
.orElseGet(Stream::empty))
|
.orElseGet(Stream::empty))
|
||||||
.filter(Customer::hasOverThousandPoints)
|
.filter(Customer::hasOverHundredPoints)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
assertThat(customersWithMoreThan100Points).hasSize(2);
|
assertThat(customersWithMoreThan100Points).hasSize(2);
|
||||||
|
|
Loading…
Reference in New Issue