class FullJitterDelay extends ExponentialDelay {

    private final Duration upper;

    private final long base;

    private final TimeUnit targetTimeUnit;

    FullJitterDelay(Duration lower, Duration upper, long base, TimeUnit targetTimeUnit) {
        super(lower, upper, 2, targetTimeUnit);
        this.upper = upper;
        this.base = base;
        this.targetTimeUnit = targetTimeUnit;
    }

    @Override
    public Duration createDelay(long attempt) {<FILL_FUNCTION_BODY>}

}


        long upperTarget = targetTimeUnit.convert(upper.toNanos(), TimeUnit.NANOSECONDS);
        long upperBase = base * calculatePowerOfTwo(attempt);
        long temp = Math.min(upperTarget, 0 > upperBase ? upperTarget : upperBase);
        long delay = temp / 2 + randomBetween(0, temp / 2);
        return applyBounds(Duration.ofNanos(targetTimeUnit.toNanos(delay)));
    
<methods>public java.time.Duration createDelay(long) <variables>private final non-sealed java.time.Duration lower,private final non-sealed int powersOf,private final non-sealed java.util.concurrent.TimeUnit targetTimeUnit,private final non-sealed java.time.Duration upper