Here you can find the source of getCommaSeparatedList(Collection
public static String getCommaSeparatedList(Collection<String> stringValues)
//package com.java2s; /*L//ww w .ja v a 2s. c o m * Copyright SAIC, Ellumen and RSNA (CTP) * * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/national-biomedical-image-archive/LICENSE.txt for details. */ import java.util.Collection; import java.util.Iterator; public class Main { /** * Utility method for creating display values * * @see gov.nih.nci.ncia.criteria.Criteria#getDisplayValue() */ public static String getCommaSeparatedList(Collection<String> stringValues) { // Create a comma separated list StringBuilder values = new StringBuilder(); if (stringValues.size() == 0) { return values.toString(); } Iterator<String> i = stringValues.iterator(); values.append((String) i.next()); while (i.hasNext()) { values.append(", "); values.append((String) i.next()); } return values.toString(); } }