infobox manager: keep infoboxes in order of insertion

Collections.binarySearch() does not guarantee which element is found if
there are multiple that compare equal, leaving the order of infoboxes
not necessarily in insertion order. This was an unintended side effect of
ba9ffb1d60 and
406c2bc7db.
This commit is contained in:
Adam
2020-07-01 19:18:30 -04:00
parent 67030e38a4
commit 83607f1335
2 changed files with 40 additions and 2 deletions

View File

@@ -114,5 +114,8 @@ public class InfoBoxManagerTest
infoBoxManager.addInfoBox(new TestInfobox(InfoBoxPriority.MED, "three"));
assertEquals(3, infoBoxManager.getInfoBoxes().size());
assertEquals("one", infoBoxManager.getInfoBoxes().get(0).getText());
assertEquals("two", infoBoxManager.getInfoBoxes().get(1).getText());
assertEquals("three", infoBoxManager.getInfoBoxes().get(2).getText());
}
}