Skip to content

Commit f1043d3

Browse files
author
Hector Romero
committed
BAEL-7: Small tweaks
1 parent de33c9c commit f1043d3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎core-java/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void whenJoiningTwoArrays_thenJoined() {
2323
String[] animals1 = new String[] { "Dog", "Cat" };
2424
String[] animals2 = new String[] { "Bird", "Cow" };
2525
String[] result = Stream.concat(Arrays.stream(animals1), Arrays.stream(animals2))
26-
.toArray(size -> new String[size]);
26+
.toArray(String[]::new);
2727

2828
assertArrayEquals(result, new String[] { "Dog", "Cat", "Bird", "Cow" });
2929
}
@@ -170,7 +170,8 @@ public void whenConvertCollectionToStringMultipleSeparators_thenConverted() {
170170
String fruits = "Apple. , Orange, Grape. Lemon";
171171

172172
Collection<String> result = Arrays.stream(fruits.split("[,|.]"))
173-
.map(String::trim).filter(next -> !next.isEmpty())
173+
.map(String::trim)
174+
.filter(next -> !next.isEmpty())
174175
.collect(Collectors.toList());
175176

176177
assertTrue(result.equals(Arrays.asList("Apple", "Orange", "Grape", "Lemon")));

0 commit comments

Comments
 (0)