DeferredHelper { public static Deferred<Long> deferred(AtomicLong atomic) { return new DeferredAtomicLong(atomic); }  static Deferred<Long> deferred(AtomicLong atomic); static Deferred<Integer> deferred(AtomicInteger atomic); static Deferred<Boolean> deferred(AtomicBoolean atomic); static Deferred<T> deferred(Callable<T> callable,
                                           Class<T>    callableReturnType); static Iterator<Duration> getDefaultEnsuredRetryDurations(); static Iterable<Duration> getDefaultEnsuredRetryDurationsIterable(); static Duration getDefaultEnsuredMaximumRetryDuration(); static long getDefaultEnsuredTimeoutMS(); static Duration getDefaultEnsuredMaximumPollingDuration(); static Deferred<T> ensured(Deferred<T> deferred); static Deferred<T> ensured(Deferred<T> deferred,
                                          Option...   options); static T ensure(T value); static T ensure(Deferred<T> deferred); static T ensure(Deferred<T> deferred,
                               Option...   options); static boolean ensure(Deferred<T>          deferred,
                                     Predicate<? super T> predicate); static Cached<T> cached(Deferred<T> deferred); static Deferred<T> future(Class<T>                       clzOfResult,
                                         java.util.concurrent.Future<T> future); static T invoking(T object); static T invoking(O        object,
                                    Class<T> specificClass); static T invoking(Deferred<T> deferred); static T valueOf(Deferred<T> deferred); static T valueOf(Callable<T> callable,
                                Class<T>    returnType); static Integer valueOf(AtomicInteger atomic); static Long valueOf(AtomicLong atomic); static Boolean valueOf(AtomicBoolean atomic); static T valueOf(Callable<T> callable); @SuppressWarnings("unchecked") static Deferred<T> eventually(T t); @SuppressWarnings("unchecked") static Deferred<T> eventually(Deferred<T> t); static Timeout within(long     duration,
                                 TimeUnit units); static Timeout within(Timeout timeout); static InitialDelay delayedBy(long     duration,
                                         TimeUnit units); static final String BEDROCK_DEFERRED_RETRY_STRATEGY; static final String BEDROCK_DEFERRED_RETRY_TIMEOUT; static final long BEDROCK_DEFERRED_RETRY_TIMEOUT_SECS; static final String BEDROCK_DEFERRED_MAXIMUM_POLLING_TIME; static final long BEDROCK_DEFERRED_MAXIMUM_POLLING_TIME_MS; }
@Test public void shouldDeferAnAtomicLong() { AtomicLong a = new AtomicLong(1); Deferred<Long> deferred = DeferredHelper.deferred(a); Assert.assertEquals(new Long(1), deferred.get()); }
@Test public void shouldDeferAnAtomicInteger() { AtomicInteger a = new AtomicInteger(1); Deferred<Integer> deferred = DeferredHelper.deferred(a); Assert.assertEquals(new Integer(1), deferred.get()); }
@Test public void shouldDeferAnAtomicBoolean() { AtomicBoolean a = new AtomicBoolean(true); Deferred<Boolean> deferred = DeferredHelper.deferred(a); Assert.assertEquals(Boolean.TRUE, deferred.get()); }