Added a unit test for tie-breaking.