Fix Utils.nonEmptyAndNullJoin

When using the index here, it the index needs to be decremented once an element is removed. To cirecumvent this, the native Collections.removeIf() method is used.
This commit is contained in:
TobiGr
2021-02-21 12:51:47 +01:00
parent b9e8ee8450
commit 70814dcfef
2 changed files with 4 additions and 8 deletions

View File

@@ -20,6 +20,7 @@ public class UtilsTest {
@Test
public void testJoin() {
assertEquals("some,random,stuff", Utils.join(",", Arrays.asList("some", "random", "stuff")));
assertEquals("some,random,not-null,stuff", Utils.nonEmptyAndNullJoin(",", new String[]{"some", "null", "random", "", "not-null", null, "stuff"}));
}
@Test