iteratorFilter = (iterator, filter) => createIterator(() => {
  let res;

  do {
    res = iterator.next();
  } while (!res.done && !filter(res.value));

  return res;
})
@template T
@param {Iterator<T>} iterator
@param {function(T):boolean} filter