RetriableCommand { public RetriableCommand(String description) { this.description = description; } RetriableCommand(String description);  RetriableCommand(String description, RetryPolicy retryPolicy); Object execute(Object... arguments); RetriableCommand setRetryPolicy(RetryPolicy retryHandler);  }
@Test public void testRetriableCommand() { try { new MyRetriableCommand(5).execute(0); Assert.assertTrue(false); } catch (Exception e) { Assert.assertTrue(true); } try { new MyRetriableCommand(3).execute(0); Assert.assertTrue(true); } catch (Exception e) { Assert.assertTrue(false); } try { new MyRetriableCommand(5, RetryPolicies. retryUpToMaximumCountWithFixedSleep(5, 0, TimeUnit.MILLISECONDS)).execute(0); Assert.assertTrue(true); } catch (Exception e) { Assert.assertTrue(false); } }