ArrayList<ObjectDoublePair> lsps = new ArrayList<ObjectDoublePair>();
TObjectFloatIterator mi = m.iterator();
while (mi.hasNext()) {
mi.advance();
lsps.add(new ObjectDoublePair(mi.key(), mi.value()));
}
ObjectDoublePairComparator lspComparator = new ObjectDoublePairComparator();
Collections.sort(lsps, lspComparator);