Here you can find the source of sortString(Set
public static List<String> sortString(Set<String> lists)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; public class Main { public static List<String> sortString(Set<String> lists) { if (lists == null) { return null; } else {//from w w w . j av a2 s . c o m List<String> result = new ArrayList<String>(); for (String domain : lists) { result.add(domain); } Collections.sort(result); return result; } } public static List<String> sort(List<String> lists) { Collections.sort(lists); return lists; } public static List<String> sort(Set<String> lists) { if (lists == null) { return null; } else { List<String> result = new ArrayList<String>(); for (String temp : lists) { result.add(temp); } return sort(result); } } }