### Question:
Backoff { public synchronized void startRequest() { lastRequestStart = ticker.read(); } Backoff(Duration maxFailureInterval);  Backoff(Duration maxFailureInterval, Ticker ticker); @VisibleForTesting  Backoff(int minTries, Duration maxFailureInterval, Ticker ticker, List<Duration> backoffDelayIntervals); synchronized long getFailureCount(); synchronized Duration getFailureDuration(); synchronized Duration getFailureRequestTimeTotal(); synchronized void startRequest(); synchronized void success(); synchronized boolean failure(); synchronized long getBackoffDelayNanos();  }### Answer:
@Test public void testStartRequest() { TestingTicker ticker = new TestingTicker(); ticker.increment(1, NANOSECONDS); Backoff backoff = new Backoff(1, new Duration(15, SECONDS), ticker, ImmutableList.of(new Duration(10, MILLISECONDS))); ticker.increment(10, MICROSECONDS); assertFalse(backoff.failure()); assertEquals(backoff.getFailureCount(), 1); assertEquals(backoff.getFailureDuration().roundTo(SECONDS), 0); assertEquals(backoff.getFailureRequestTimeTotal().roundTo(SECONDS), 0); ticker.increment(7, SECONDS); backoff.startRequest(); ticker.increment(7, SECONDS); assertFalse(backoff.failure()); assertEquals(backoff.getFailureCount(), 2); assertEquals(backoff.getFailureDuration().roundTo(SECONDS), 14); assertEquals(backoff.getFailureRequestTimeTotal().roundTo(SECONDS), 7); ticker.increment(1, SECONDS); backoff.startRequest(); ticker.increment(1, SECONDS); assertTrue(backoff.failure()); assertEquals(backoff.getFailureCount(), 3); assertEquals(backoff.getFailureDuration().roundTo(SECONDS), 16); assertEquals(backoff.getFailureRequestTimeTotal().roundTo(SECONDS), 8); }