I am using TreeBidiMap from the Apache Collections library. I want to sort this on the values which are doubles.
TreeBidiMap
doubles
My method is to retrieve a
List list = new ArrayList(coll); Collections.sort(list);
As Erel Segal Halevi says below, if coll is already a list, you can skip step one. But that would depend on the internals of TreeBidiMap.
List list; if (coll instanceof List) list = (List)coll; else list = new ArrayList(coll);