Here you can find the source of getSortedKetList(HashMap
public static List<String> getSortedKetList(HashMap<String, Integer> numKnownGenesHashMap)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Set; public class Main { public static List<String> getSortedKetList(HashMap<String, Integer> numKnownGenesHashMap) { List<String> ret = new ArrayList<String>(); final Set<String> keySet = numKnownGenesHashMap.keySet(); for (String key : keySet) { ret.add(key);//from w w w.j a va 2s .c o m } Collections.sort(ret); return ret; } }