@Test(expected = NoSuchAlgorithmException.class) public void testRetriableCall() throws Exception { Retriable<String> retriableString = new Retriable<String>() { @Override public String retriableCall() throws NoSuchAlgorithmException { return "TestString"; } }; Assert.assertEquals("TestString", retriableString.retriableCall()); Retriable<Object> retriableThrows = new Retriable<Object>() { @Override public Object retriableCall() throws NoSuchAlgorithmException { throw new NoSuchAlgorithmException(); } }; try { retriableThrows.retriableCall(); Assert.fail("retriableThrows does not throw!"); } catch (Exception e) { throw e; } }
public abstract T retriableCall() throws NoSuchAlgorithmException;
Retriable { public abstract T retriableCall() throws NoSuchAlgorithmException; }
Retriable { public abstract T retriableCall() throws NoSuchAlgorithmException;  }
Retriable { public abstract T retriableCall() throws NoSuchAlgorithmException;  abstract T retriableCall(); T retryCallOnFail(int times, long timeout); }
Retriable { public abstract T retriableCall() throws NoSuchAlgorithmException;  abstract T retriableCall(); T retryCallOnFail(int times, long timeout);  }