Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; public class Main { public static List convertMapToList(Map map) { List list = new ArrayList(); Object[] o = ((HashMap) map).keySet().toArray(); Arrays.sort(o); for (int i = 0; i <= o.length - 1; i++) { if (map.containsKey(String.valueOf(o[i]))) { list.add(map.get(String.valueOf(o[i]))); } else { list.add(map.get("")); } } return list; } public static void sort(List objectsList, String fieldName, boolean asc) { // AlgorithmUtils utils = new AlgorithmUtils(); // YISComparator yisComparator = utils.new YISComparator(fieldName,asc); // Collections.sort(objectsList, yisComparator); } }