ICalVCardHelper { public String concatenateStrings(String delimiter, String... parts) { if (parts == null) { return ""; } if (delimiter == null) { delimiter = ""; } return Stream.<String> of(parts) .map(StringUtility::emptyIfNull) .collect(Collectors.joining(delimiter)); }  T parse(Reader r, String characterSet, T entity); void write(AbstractEntity entity, Writer writer, String charset); byte[] toBytes(AbstractEntity entity, String charset); String createDate(Date d); String createDateTime(Date d); String formatDurationAsNegative(Duration d); String concatenateStrings(String delimiter, String... parts); String composeStructuredValueFromSingleValues(String... values); String composeStructuredValue(String... values); String concatenateListOfValues(String... values); String[] backslashEscape(char c, String... values); String[] backslashEscape(char[] chars, String... values); boolean isCharacterSetSupported(String charset);  }
@Test public void testConcatenateStrings() { ICalVCardHelper helper = BEANS.get(ICalVCardHelper.class); assertEquals("", helper.concatenateStrings(null)); assertEquals("", helper.concatenateStrings(null, (String[]) null)); assertEquals("", helper.concatenateStrings(".", (String[]) null)); assertEquals(".", helper.concatenateStrings(".", null, null)); assertEquals("", helper.concatenateStrings("", "", "", "")); assertEquals("..", helper.concatenateStrings(".", "", "", "")); assertEquals(helper.concatenateStrings("", "test1", "test2", "test3"), helper.concatenateStrings(null, "test1", "test2", "test3")); assertEquals("abc.def.ghi", helper.concatenateStrings(".", "abc", "def", "ghi")); assertEquals("abc..def..ghi.", helper.concatenateStrings(".", "abc", null, "def", null, "ghi", null)); assertEquals("abcabcabc", helper.concatenateStrings("abc", "abc", "abc")); assertEquals("1234567890_§¦@#°§¬|¢)=´~_1234567890", helper.concatenateStrings("§¦@#°§¬|¢)=´~", "1234567890_", "_1234567890")); }