From f1043d3b526da61f16b8744cfb249de59173ceab Mon Sep 17 00:00:00 2001 From: Hector Romero Date: Fri, 2 Dec 2016 03:47:24 -0600 Subject: [PATCH] BAEL-7: Small tweaks --- .../java/collections/JoinSplitCollectionsUnitTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core-java/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java b/core-java/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java index 66e037b457..7e43fef9fa 100644 --- a/core-java/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java +++ b/core-java/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java @@ -23,7 +23,7 @@ public class JoinSplitCollectionsUnitTest { String[] animals1 = new String[] { "Dog", "Cat" }; String[] animals2 = new String[] { "Bird", "Cow" }; String[] result = Stream.concat(Arrays.stream(animals1), Arrays.stream(animals2)) - .toArray(size -> new String[size]); + .toArray(String[]::new); assertArrayEquals(result, new String[] { "Dog", "Cat", "Bird", "Cow" }); } @@ -170,7 +170,8 @@ public class JoinSplitCollectionsUnitTest { String fruits = "Apple. , Orange, Grape. Lemon"; Collection result = Arrays.stream(fruits.split("[,|.]")) - .map(String::trim).filter(next -> !next.isEmpty()) + .map(String::trim) + .filter(next -> !next.isEmpty()) .collect(Collectors.toList()); assertTrue(result.equals(Arrays.asList("Apple", "Orange", "Grape", "Lemon")));