### Question:
RetryerUtils { public static boolean retryCallSilent(final Callable<Boolean> callable, boolean checkResult) { boolean result = false; try { result = getDefaultRetryer(checkResult).call(callable); } catch (ExecutionException | RetryException e) { logger.warn("Retry call {} failed {}", callable, e.getMessage(), e); } return result; } private  RetryerUtils(); static Retryer<Boolean> getDefaultRetryer(boolean checkResult); static Retryer<Boolean> getDefaultRetryer(); static Boolean retryCall(final Callable<Boolean> callable, boolean checkResult); static Boolean retryCall(final Callable<Boolean> callable); static boolean retryCallSilent(final Callable<Boolean> callable, boolean checkResult); static boolean retryCallSilent(final Callable<Boolean> callable);  }### Answer:
@Test public void testRetrySilent() { try { for (int execTarget = 1; execTarget <= 3; execTarget++) { int finalExecTarget = execTarget; int[] execTime = {0}; boolean result = RetryerUtils.retryCallSilent(() -> { execTime[0]++; return execTime[0] == finalExecTarget; }); Assert.assertEquals(finalExecTarget, execTime[0]); Assert.assertTrue(result); } } catch (Exception e) { Assert.fail("Unexpected exception " + e.getMessage()); } int[] execTime = {0}; try { boolean result = RetryerUtils.retryCallSilent(() -> { execTime[0]++; return execTime[0] == 4; }); Assert.assertFalse(result); } catch (Exception e) { Assert.fail("Unexpected exception " + e.getMessage()); } }
@Test public void testRetrySilentWithPara() { try { for (int execTarget = 1; execTarget <= 3; execTarget++) { int finalExecTarget = execTarget; int[] execTime = {0}; boolean result = RetryerUtils.retryCallSilent(() -> { execTime[0]++; return execTime[0] == finalExecTarget; }, true); Assert.assertEquals(finalExecTarget, execTime[0]); Assert.assertTrue(result); } } catch (Exception e) { Assert.fail("Unexpected exception " + e.getMessage()); } int[] execTime = {0}; try { boolean result = RetryerUtils.retryCallSilent(() -> { execTime[0]++; return execTime[0] == 4; }, true); Assert.assertFalse(result); } catch (Exception e) { Assert.fail("Unexpected exception " + e.getMessage()); } }
@Test public void testRetrySilentNoCheckResult(){ try { for (int execTarget = 1; execTarget <= 5; execTarget++) { int[] execTime = {0}; boolean result = RetryerUtils.retryCallSilent(() -> { execTime[0]++; return execTime[0] > 1; }, false); Assert.assertEquals(1, execTime[0]); Assert.assertFalse(result); } } catch (Exception e) { Assert.fail("Unexpected exception " + e.getMessage()); } }