Here you can find the source of join(String separator, Collection> items)
public static String join(String separator, Collection<?> items)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static String join(String separator, Collection<?> items) { StringBuilder sb = new StringBuilder(); for (Object item : items) if (item != null) sb.append(separator).append(item); return sb.substring(separator.length()); }/*from w ww . j a v a2 s .co m*/ }