Here you can find the source of toHtml(Collection collection)
public static String toHtml(Collection collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Iterator; public class Main { public static String toHtml(Collection collection) { StringBuffer sb = new StringBuffer(); sb.append("<ul>"); Iterator iterator = collection.iterator(); while (iterator.hasNext()) { sb.append("<li>"); sb.append(iterator.next());/* w w w. j ava2 s . c o m*/ sb.append("</li>"); } sb.append("</ul>"); return sb.toString(); } }