public static <S> RemoteIterator<S> filteringRemoteIterator(
      RemoteIterator<S> iterator,
      FunctionRaisingIOE<? super S, Boolean> filter) {
    return new FilteringRemoteIterator<>(iterator, filter);
  }
@Test
  public void testFiltering() throws Throwable {
    CountdownRemoteIterator countdown = new CountdownRemoteIterator(100);
    // only even numbers are passed through
    RemoteIterator<Integer> it = filteringRemoteIterator(
        countdown,
        i -> (i % 2) == 0);
    verifyInvoked(it, 50, c -> counter++);
    assertCounterValue(50);
    extractStatistics(it);
    close(it);
    countdown.assertCloseCount(1);
  }