findIndex method
Implementation
int findIndex(int initial, bool Function(E element) query) {
Iterator<E> iterator = this.iterator;
if (!iterator.moveNext()) return initial;
int index = 0;
if (query(iterator.current)) return index;
while (iterator.moveNext()) {
if (query(iterator.current)) return index;
index++;
}
return initial;
}