RetryPolicy implements SyncRetryExecutor<T, C> { public static <T, C extends Callable<? extends T>> RetryPolicy<T, C> noRetryPolicy() { return (RetryPolicy<T, C>) NO_RETRY; } RetryPolicy(final TimedSupplier<RetryPredicate<T, C>> retryPredicate,
          final int maxExceptionChain); static RetryPolicy<T, C> noRetryPolicy(); static RetryPolicy<T, C> defaultPolicy(); @Override final R call(
          final W pwhat, final Class<EX> exceptionClass, final long startNanos, final long deadlineNanos); final AsyncRetryExecutor<T, C> async(final FailSafeExecutor exec); final AsyncRetryExecutor<T, C> async(final HedgePolicy hedgePolicy, final FailSafeExecutor exec); final AsyncRetryExecutor async(); final RetryPredicate<T, C> getRetryPredicate(final long startTimeNanos, final long deadlineNanos); @Override String toString(); @CheckReturnValue static Builder<T, C> newBuilder(); @CheckReturnValue static Builder<T, C> newBuilder(final Builder<T, C> builder);  }
@Test public void testNoRetryPolicy() throws IOException, InterruptedException, TimeoutException { LogAssert vex = TestLoggers.sys().dontExpect(PREDICATE_CLASS, Level.DEBUG, Matchers.any(TestLogRecord.class)); try (LogAssert expect = vex) { RetryPolicy.noRetryPolicy().run(() -> { throw new IOException(); }, IOException.class); Assert.fail(); } catch (IOException ex) { vex.assertObservation(); } }