public static String join(Iterable<?> iterable,String separator){
  final StringBuilder sb=new StringBuilder();
  boolean first=true;
  for (  Object item : iterable) {
    if (first) {
      first=false;
    }
 else {
      sb.append(separator);
    }
    sb.append(item.toString());
  }
  return sb.toString();
}

public static String join ( Iterable < ? > iterable , String separator ) { final StringBuilder sb = new StringBuilder ( ) ; boolean first = true ; for ( Object item : iterable ) { if ( first ) { first = false ; } else { sb . append ( separator ) ; } sb . append ( item . toString ( ) ) ; } return sb . toString ( ) ; }
creates a string of all elements of an iterable , separated by a separator .
