public void testIndexSimple() { LongArray source = LongArray.create(1, 3, 4, 7, 8, 9); LongListInsertingDecorator tst = new LongListInsertingDecorator(source, new IntLongListMap()); IntArray toInsert = IntArray.create(0, 2, 5, 6, 10); for (IntIterator it : toInsert) { tst.insert(it.value(), it.value()); } // [0*, 1, 2*, 3, 4, 5*, 6*, 7, 8, 9, 10*] LongListIterator it = tst.iterator(); while (it.hasNext()) { it.next(); assertEquals(it.index(), it.value()); } checkCollection(tst, LongProgression.Arithmetic.nativeArray(0, 11, 1)); }
it.next(); assertEquals(index++, it.index());