private static Duration requireNonNegative(Duration d) {
        if (d.isNegative()) throw new IllegalArgumentException("Invalid duration: " + d);
        return d;
    }
Return the delay of given attempt
vespajlib/src/main/java/com/yahoo/time/ExponentialBackoff.java