indexOf on sorted lists should return the first match
This commit is contained in:
@@ -680,6 +680,13 @@ public class IntListTest {
|
||||
Assert.assertEquals(1, list.indexOf(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIndexOfOnSortedListReturnsFirstMatch() {
|
||||
final IntList list = IntList.of(0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4);
|
||||
Assert.assertEquals(2, list.indexOf(2));
|
||||
Assert.assertEquals(4, list.indexOf(2, 4));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIndexOfOnUnsortedList() {
|
||||
final IntList list = IntList.of(2, 0, 1);
|
||||
|
||||
Reference in New Issue
Block a user