@Test
public void testExecuteWithRetry4args2() throws Exception {

  long startTime = TimeSource.nanoTime();
  Integer result = Callables.executeWithRetry(new TimeoutCallable<Integer, IOException>(60000) {
    private int count;
    @Override
    public Integer call(final long deadline) throws IOException {
      count++;
      if (count < 20) {
        throw new SocketException("Aaaaaaaaaaa" + count);
      }
      return 1;
    }
  }, 1, 10, IOException.class);
  long elapsedTime = TimeSource.nanoTime() - startTime;
  Assert.assertEquals(1L, result.longValue());
  Assert.assertTrue("Operation has to take at least 10 ms", elapsedTime > TimeUnit.MILLISECONDS.toNanos(10));
}