coerceToBagEntries = bagEntriesList => {
  const bagEntries = sortByRank(bagEntriesList, compareAntiRank);
  assertBagEntries(bagEntries);
  return bagEntries;
}
@template {Key} K
@param {Iterable<[K, bigint]>} bagEntriesList