StringUtils { public static String toCommaSeparatedString(String... strings) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < strings.length; i++) { String value = strings[i]; if (i > 0) { sb.append(","); } sb.append(value); } return sb.toString(); } private  StringUtils(); static String removeStart(final String str, final String remove); static String capitalize(String self); static String splitCamelCase(String s); static String[] split(final String str, final char separatorChar); static String dateAsIsoString(Date date); static String timestampAsIsoString(long timestamp); static String slugify(String s); static boolean isNotEmpty(String s); static boolean isEmpty(String s); static String asCsv(String[] strings); static String asCsv(Collection<?> values); static String getLogstashStyleDate(); static String getLogstashStyleDate(long time); static String replaceWhitespacesWithDash(String s); static String toCommaSeparatedString(String... strings); static String removeTrailingSlash(String url); static String sha1Hash(String s); static String bytesToHex(byte[] bytes); static String toHexString(long l); static String deDot(String s); static String reDot(String s);  }
@Test public void testToCommaSeparatedString() { assertThat(StringUtils.toCommaSeparatedString("foo", "bar")).isEqualTo("foo,bar"); assertThat(StringUtils.toCommaSeparatedString("foo")).isEqualTo("foo"); assertThat(StringUtils.toCommaSeparatedString()).isEqualTo(""); }