renaming method according to content: thousand -> hundred

This commit is contained in:
cror 2019-01-16 17:14:35 +01:00
parent 438ff48c27
commit 2b7e66a398
3 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ public class Customer {
return this.points > points;
}
public boolean hasOverThousandPoints() {
public boolean hasOverHundredPoints() {
return this.points > 100;
}

View File

@ -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);

View File

@ -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);