From ac619f1f4bb627a58d4711e71cf6e7da76dfdb8c Mon Sep 17 00:00:00 2001 From: panos-kakos <102670093+panos-kakos@users.noreply.github.com> Date: Sun, 11 Sep 2022 07:29:03 +0100 Subject: [PATCH] [JAVA-14461] Improvement/ making code more declarative (#12710) Co-authored-by: panagiotiskakos --- .../baeldung/bifunction/BiFunctionalInterfacesUnitTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java b/core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java index ea63409c88..0ae59d9f77 100644 --- a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java +++ b/core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java @@ -71,7 +71,7 @@ public class BiFunctionalInterfacesUnitTest { List list1 = Arrays.asList("a", "b", "c"); List list2 = Arrays.asList(1, 2, 3); - List result = listCombiner(list1, list2, (a, b) -> a + b); + List result = listCombiner(list1, list2, (letter, number) -> letter + number); assertThat(result).containsExactly("a1", "b2", "c3"); } @@ -92,7 +92,7 @@ public class BiFunctionalInterfacesUnitTest { List list2 = Arrays.asList(0.1f, 0.2f, 4f); // algorithm to determine if the value in list1 > value in list 2 - List result = listCombiner(list1, list2, (a, b) -> a > b); + List result = listCombiner(list1, list2, (doubleNumber, floatNumber) -> doubleNumber > floatNumber); assertThat(result).containsExactly(true, true, false); } @@ -117,7 +117,7 @@ public class BiFunctionalInterfacesUnitTest { List list1 = Arrays.asList(0.1f, 0.2f, 4f); List list2 = Arrays.asList(0.1f, 0.2f, 4f); - List result = listCombiner(list1, list2, (a, b) -> a.equals(b)); + List result = listCombiner(list1, list2, (float1, float2) -> float1.equals(float2)); assertThat(result).containsExactly(true, true, true); }