List<E> mapIndexedWhere<T>(T Function(E value, int index) f) { var i = 0; return map((e) => f(e, i++)).whereType<E>().toList(); }