Here you can find the source of toAlphaCollection(Collection collection)
public static <U extends Comparable<? super U>> Iterable<U> toAlphaCollection(Collection<U> collection)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <U extends Comparable<? super U>> Iterable<U> toAlphaCollection(Collection<U> collection) { Iterator<U> it = collection.iterator(); List<U> list = new ArrayList<U>(); while (it.hasNext()) { list.add(it.next());/*from ww w . j a v a 2 s. c o m*/ } Collections.sort(list); return list; } }