A small service collects report rows for orders and prints them in sorted form. After a recent change, the row order started to differ from what was expected for repeated and near-equal values.
Scala 3.3.1 and JDK 21.scala-cli without additional libraries.priority in ascending order, then by code alphabetically.priority and code are equal, the original order of the input rows must not change.3 A12
1 B02
1 A11
1 A09
3 A01
priority, then by code.priority may come out in an order that does not match the second field.1 A09
1 A11
1 B02
3 A01
3 A12
scala-cli run .Use line comments to explain the problem, its impact, the fix and how to test it.