@Test
public void test_asCallable_callback() throws Exception {

    RetryCallback<Long, Exception> callback = Mockito.mock(RetryCallback.class);
    ExtendedRetryTemplate template = new ExtendedRetryTemplate();
    Mockito.when(callback.doWithRetry(Mockito.any(RetryContext.class))).thenReturn(10L);
    Callable<Long> wrapped = template.asCallable(callback);
    Assert.assertEquals(10L, wrapped.call().longValue());
    Mockito.verify(callback, Mockito.times(1)).doWithRetry(Mockito.any(RetryContext.class));
}