public static String toSepList(Iterator stringIter,String sep){
  StringBuilder sb=new StringBuilder();
  if (stringIter.hasNext()) {
    sb.append((String)stringIter.next());
  }
  while (stringIter.hasNext()) {
    sb.append(sep);
    sb.append((String)stringIter.next());
  }
  return sb.toString();
}

public static String toSepList ( Iterator stringIter , String sep ) { StringBuilder sb = new StringBuilder ( ) ; if ( stringIter . hasNext ( ) ) { sb . append ( ( String ) stringIter . next ( ) ) ; } while ( stringIter . hasNext ( ) ) { sb . append ( sep ) ; sb . append ( ( String ) stringIter . next ( ) ) ; } return sb . toString ( ) ; }
takes iterator over string , and separator string , and returns a separated list as string , e . g . [ " a " , " b " , " c " ] and " , " - > " a , b , c "
