Resilience code runs rarely and matters most when it does. In Java it has its own edges: a long shifted by 64 wraps back to 1, doubling past Long.MAX_VALUE turns negative, and a cache that only grows eventually runs the service out of memory.
You will write backoff with saturating arithmetic, a circuit breaker whose states are an enum and whose transitions are a switch, a retry loop that keeps time with java.time.Duration so units can't be mixed up, and a bounded cache of recent idempotency keys on LinkedHashMap's access order.
Times are passed in as data, which is how this code is tested in production projects too. The browser runtime has no threads, so nothing here sleeps.
Java longs wrap silently: backoff code has to saturate.