Map hashMap = new HashMap();
List arrayList = new ArrayList(hashMap.entrySet());
Collections.sort(arrayList, new Comparator() {
public int compare(Object o1, Object o2) {
Map.Entry obj1 = (Map.Entry) o1;
Map.Entry obj2 = (Map.Entry) o2;
return (obj1.getKey()).toString().compareTo(obj2.getKey());
}
});