Here you can find the source of sortUniq(List
public static List<String> sortUniq(List<String> list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static List<String> sortUniq(List<String> list) { HashSet<String> tmp = new HashSet<String>(); for (String a : list) { tmp.add(a);/*from ww w.j ava2s .com*/ } List<String> result = new ArrayList<String>(); result.addAll(tmp); Collections.sort(result); return result; } }