// probably not needed as WithProbability can compare itself static Comparator> probabilityComparator() { ret (a, b) -> cmp(b.probability, a.probability); }