public static String join(String separator,List<?> elements){
  if (elements == null || elements.size() == 0) {
    return "";
  }
  StringBuffer sb=new StringBuffer(elements.size() * 3);
  int i=0;
  for (  Object elem : elements) {
    if (i++ > 0) {
      sb.append(separator);
    }
    sb.append(format(elem));
  }
  return sb.toString();
}

public static String join ( String separator , List < ? > elements ) { if ( elements == null || elements . size ( ) == 0 ) { return "" ; } StringBuffer sb = new StringBuffer ( elements . size ( ) * 3 ) ; int i = 0 ; for ( Object elem : elements ) { if ( i ++ > 0 ) { sb . append ( separator ) ; } sb . append ( format ( elem ) ) ; } return sb . toString ( ) ; }
returns a string containing all elements concatenated by a specified separator .
