Here you can find the source of combine(Collection
private static String combine(Collection<String> strings)
//package com.java2s; //License from project: LGPL import java.util.Collection; import java.util.Iterator; public class Main { private static String combine(Collection<String> strings) { Iterator<String> iter = strings.iterator(); if (!iter.hasNext()) { return ""; }/*from w ww.ja v a 2 s . c om*/ String rtrn = iter.next(); while (iter.hasNext()) { rtrn += "_" + iter.next(); } return rtrn; } }