Here you can find the source of toString(Collection softwareTags)
public static String toString(Collection softwareTags)
//package com.java2s; import java.util.Collection; import java.util.Iterator; public class Main { private static final char QUOTE = '\"'; private static final char SPACE = ' '; public static String toString(Collection softwareTags) { StringBuffer sb = new StringBuffer(); for (Iterator i = softwareTags.iterator(); i.hasNext();) { Object softwareTag = i.next(); String tagName = null; /*if (softwareTag instanceof SoftwareTag) { tagName = ((SoftwareTag) softwareTag).getTagName(); } else {/*w ww . j a v a 2 s .com*/ tagName = softwareTag.toString(); }*/ sb.append(SPACE); if (tagName.indexOf(SPACE) != -1) { sb.append(QUOTE).append(tagName).append(QUOTE); } else { sb.append(tagName); } } return sb.toString().trim(); } }