From 2b7e66a3989bebd92e76d4d116f74b72db2edcc4 Mon Sep 17 00:00:00 2001 From: cror Date: Wed, 16 Jan 2019 17:14:35 +0100 Subject: [PATCH] renaming method according to content: thousand -> hundred --- .../src/main/java/com/baeldung/stream/filter/Customer.java | 2 +- .../java/com/baeldung/stream/filter/StreamCountUnitTest.java | 2 +- .../java/com/baeldung/stream/filter/StreamFilterUnitTest.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/java-streams/src/main/java/com/baeldung/stream/filter/Customer.java b/java-streams/src/main/java/com/baeldung/stream/filter/Customer.java index 49da6e7175..fd4f6021ff 100644 --- a/java-streams/src/main/java/com/baeldung/stream/filter/Customer.java +++ b/java-streams/src/main/java/com/baeldung/stream/filter/Customer.java @@ -32,7 +32,7 @@ public class Customer { return this.points > points; } - public boolean hasOverThousandPoints() { + public boolean hasOverHundredPoints() { return this.points > 100; } diff --git a/java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java b/java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java index 1cad710e14..742e5aedc9 100644 --- a/java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java +++ b/java-streams/src/test/java/com/baeldung/stream/filter/StreamCountUnitTest.java @@ -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); diff --git a/java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java b/java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java index cf82802940..29190f7298 100644 --- a/java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java +++ b/java-streams/src/test/java/com/baeldung/stream/filter/StreamFilterUnitTest.java @@ -62,7 +62,7 @@ public class StreamFilterUnitTest { List 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);