@Test
public void gatherShouldPropagateInterruptedAsIOException() throws Exception {

  var futures = List.of(completedFuture("foo"), future);
  Thread.currentThread().interrupt();
  try {
    FutureUtil.gatherIO(futures, NO_TIMEOUT);
    fail();
  } catch (IOException e) {
    assertThat(e.getCause(), instanceOf(InterruptedException.class));
  }
  // verify that gatherIO interrupts current thread after catching InterruptedException
  assertThat(Thread.currentThread().isInterrupted(), is(true));
  exception.expect(InterruptedException.class);
  Thread.sleep(1000);
}