@Test public void testJoin() { assertEquals("some,random,stuff", Utils.join(",", Arrays.asList("some", "random", "stuff"))); }
public static String join(final CharSequence delimiter, final Iterable<? extends CharSequence> elements) { final StringBuilder stringBuilder = new StringBuilder(); final Iterator<? extends CharSequence> iterator = elements.iterator(); while (iterator.hasNext()) { stringBuilder.append(iterator.next()); if (iterator.hasNext()) { stringBuilder.append(delimiter); } } return stringBuilder.toString(); }
Utils { public static String join(final CharSequence delimiter, final Iterable<? extends CharSequence> elements) { final StringBuilder stringBuilder = new StringBuilder(); final Iterator<? extends CharSequence> iterator = elements.iterator(); while (iterator.hasNext()) { stringBuilder.append(iterator.next()); if (iterator.hasNext()) { stringBuilder.append(delimiter); } } return stringBuilder.toString(); } }
Utils { public static String join(final CharSequence delimiter, final Iterable<? extends CharSequence> elements) { final StringBuilder stringBuilder = new StringBuilder(); final Iterator<? extends CharSequence> iterator = elements.iterator(); while (iterator.hasNext()) { stringBuilder.append(iterator.next()); if (iterator.hasNext()) { stringBuilder.append(delimiter); } } return stringBuilder.toString(); } private  Utils(); }
Utils { public static String join(final CharSequence delimiter, final Iterable<? extends CharSequence> elements) { final StringBuilder stringBuilder = new StringBuilder(); final Iterator<? extends CharSequence> iterator = elements.iterator(); while (iterator.hasNext()) { stringBuilder.append(iterator.next()); if (iterator.hasNext()) { stringBuilder.append(delimiter); } } return stringBuilder.toString(); } private  Utils(); static String removeNonDigitCharacters(String toRemove); static long mixedNumberWordToLong(String numberWord); static void checkUrl(String pattern, String url); static void printErrors(List<Throwable> errors); static String replaceHttpWithHttps(final String url); static String getQueryValue(URL url, String parameterName); static URL stringToURL(String url); static boolean isHTTP(URL url); static String removeUTF8BOM(String s); static String getBaseUrl(String url); static boolean isNullOrEmpty(final String str); static boolean isNullOrEmpty(final Collection<?> collection); static boolean isNullOrEmpty(final Map map); static boolean isWhitespace(final int c); static boolean isBlank(final String string); static String join(final CharSequence delimiter, final Iterable<? extends CharSequence> elements); }
Utils { public static String join(final CharSequence delimiter, final Iterable<? extends CharSequence> elements) { final StringBuilder stringBuilder = new StringBuilder(); final Iterator<? extends CharSequence> iterator = elements.iterator(); while (iterator.hasNext()) { stringBuilder.append(iterator.next()); if (iterator.hasNext()) { stringBuilder.append(delimiter); } } return stringBuilder.toString(); } private  Utils(); static String removeNonDigitCharacters(String toRemove); static long mixedNumberWordToLong(String numberWord); static void checkUrl(String pattern, String url); static void printErrors(List<Throwable> errors); static String replaceHttpWithHttps(final String url); static String getQueryValue(URL url, String parameterName); static URL stringToURL(String url); static boolean isHTTP(URL url); static String removeUTF8BOM(String s); static String getBaseUrl(String url); static boolean isNullOrEmpty(final String str); static boolean isNullOrEmpty(final Collection<?> collection); static boolean isNullOrEmpty(final Map map); static boolean isWhitespace(final int c); static boolean isBlank(final String string); static String join(final CharSequence delimiter, final Iterable<? extends CharSequence> elements); static final String HTTP; static final String HTTPS; }