### Question:
TruncatedBinaryBackoff implements BackoffStrategy { @Override public boolean shouldContinue(long lastBackoffMs) { Preconditions.checkArgument(lastBackoffMs >= 0); boolean stop = stopAtMax && (lastBackoffMs >= maxBackoffIntervalMs); return !stop; } TruncatedBinaryBackoff(
      Amount<Long, Time> initialBackoff,
      Amount<Long, Time> maxBackoff,
      boolean stopAtMax,
      Random random);  TruncatedBinaryBackoff(
      Amount<Long, Time> initialBackoff,
      Amount<Long, Time> maxBackoff,
      boolean stopAtMax);  TruncatedBinaryBackoff(Amount<Long, Time> initialBackoff, Amount<Long, Time> maxBackoff); @Override long calculateBackoffMs(long lastBackoffMs); @Override boolean shouldContinue(long lastBackoffMs);  }### Answer:
@Test public void testShouldContinue() { TruncatedBinaryBackoff backoff = new TruncatedBinaryBackoff(Amount.of(1L, Time.MILLISECONDS), Amount.of(6L, Time.MILLISECONDS), true); assertTrue(backoff.shouldContinue(0)); assertTrue(backoff.shouldContinue(1)); assertTrue(backoff.shouldContinue(2)); assertTrue(backoff.shouldContinue(4)); assertFalse(backoff.shouldContinue(6)); assertFalse(backoff.shouldContinue(8)); }