private String commaSeparate(Collection<String> strings)
    {
        StringBuilder buffer = new StringBuilder();
        Iterator<String> iterator = strings.iterator();
        while (iterator.hasNext())
        {
            String string = iterator.next();
            buffer.append(string);
            if (iterator.hasNext())
            {
                buffer.append(", ");
            }
        }
        return buffer.toString();
    }
private String commaSeparate ( Collection < String > strings ) { StringBuilder buffer = new StringBuilder ( ) ; Iterator < String > iterator = strings . iterator ( ) ; while ( iterator . hasNext ( ) ) { String string = iterator . next ( ) ; buffer . append ( string ) ; if ( iterator . hasNext ( ) ) { buffer . append ( ", " ) ; } } return buffer . toString ( ) ; }
Takes a list of Strings and combines them into a single comma-separated
String.
@param strings The Strings to combine.
@return The combined, comma-separated, String.