Here you can find the source of createAuthorString(Collection users)
public static String createAuthorString(Collection users)
//package com.java2s; import java.util.*; public class Main { public static String createAuthorString(Collection users) { Collection<String> alreadySeen = new ArrayList<String>(); String authorLabel = ""; Iterator c = users.iterator(); boolean firstAuthor = true; while (c.hasNext()) { String nextAuthor = (String) c.next(); if (nextAuthor == null) continue; if (alreadySeen.add(nextAuthor)) { if (firstAuthor) { authorLabel += " "; firstAuthor = false; } else { authorLabel += ", "; }//from w ww. j av a 2 s . c o m authorLabel += nextAuthor; } } return authorLabel; } }