BAEL-7: Small tweaks

This commit is contained in:
Hector Romero 2016-12-02 03:47:24 -06:00
parent de33c9ce0b
commit f1043d3b52
1 changed files with 3 additions and 2 deletions

View File

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