@Test
public void testExecuteWithRetryTimeout() {

  try {
    Callables.executeWithRetry(new TimeoutCallable<Integer, IOException>(1000) {
      private int count;
      @Override
      @SuppressFBWarnings("MDM_THREAD_YIELD")
      public Integer call(final long deadline) throws IOException, InterruptedException {
        Thread.sleep(2000);
        count++;
        if (count < 5) {
          throw new SocketException("Aaaaaaaaaaa" + count);
        }
        return 1;
      }
    }, 1, 10, IOException.class);
    Assert.fail();
  } catch (InterruptedException | IOException | TimeoutException ex) {
    Throwables.writeTo(ex, System.err, Throwables.PackageDetail.NONE);
  }
}