@Test
public void testDefaulPolicyInterruption() throws IOException, InterruptedException, TimeoutException {

  try {
    Thread t = Thread.currentThread();
    DefaultScheduler.INSTANCE.schedule(() -> t.interrupt(), 1, TimeUnit.SECONDS);
    RetryPolicy.newBuilder()
          .withRetryOnException(Exception.class, Integer.MAX_VALUE)
          .build().run(() -> {
      throw new IOException();
    }, IOException.class);
    Assert.fail();
  } catch (InterruptedException ex) {
    // expected
  }
}