/** * Created by jianjun.yu on 15-4-22. */ public class MultimapUtils { //创建简单treeMultiMap, key有序, value为普通arrayList(guava 自带treeMultiMap,value是有序,并且为set继承类) public static <Key, Value>Multimap<Key, Value> createSimpleTreeMultimap() { return Multimaps.newListMultimap(new TreeMap<Key, Collection<Value>>(), new Supplier<List<Value>>() { @Override public List<Value> get() { return Lists.newArrayList(); } }); } }
原文:http://blog.csdn.net/minna_d/article/details/45341677