### Question:
RetryExecutor { public T retryResult(Callable<T> callable) throws Exception { try { retryAttempts--; return callable.call(); } catch (Exception e) { if (retryOnException(e) && retryAttempts > 0) { sleep(timeout); return retryResult(callable); } throw e; } } RetryExecutor();  RetryExecutor(int retryAttempts, long timeout, List<Class> exceptions); T retryResult(Callable<T> callable); void retry(Runnable action); void retryChecked(CheckedRunnable action); void retrySilent(Runnable action);  }### Answer:
@Test(expected = Exception.class) public void testRetryResult() throws Exception { RetryExecutor<String> retryExecutor = new RetryExecutor<>(attempts, 3, new ArrayList<>()); String result = retryExecutor.retryResult(this::noResult); Assert.fail("The executor should throw exception"); }
@Test public void testRetryResultSuccess() throws Exception { RetryExecutor<String> retryExecutor = new RetryExecutor<>(); String result = retryExecutor.retryResult(this::successfulResult); Assert.assertEquals("Successful attempt", result); }