### Question:
ExponentialBackoffExceptionHandler implements ExceptionHandler { @Override public boolean handleException(Exception ex, int ntries) throws InterruptedException { if (ntries > maximumTries) { return false; } sleepUnit.sleep(sleepDuration * ntries); return true; } ExponentialBackoffExceptionHandler(
      int maximumTries, long sleepDuration, TimeUnit sleepUnit); @Override boolean handleException(Exception ex, int ntries); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void handleException_tooManyTries_returnsFalse() throws Exception { ExponentialBackoffExceptionHandler handler = new ExponentialBackoffExceptionHandler(1, 1, TimeUnit.SECONDS); assertFalse(handler.handleException(null, 3)); }
@Test public void handleException_wait_returnsTrue() throws Exception { ExponentialBackoffExceptionHandler handler = new ExponentialBackoffExceptionHandler(2, 1, TimeUnit.SECONDS); assertTrue(handler.handleException(null, 1)); }