@Test
public void testCallFailsOnBadException() throws Exception {

  MockSleeper sleeper = new MockSleeper();
  ArrayList<Exception> exceptions = new ArrayList<>();
  exceptions.add(new IllegalArgumentException("FakeException"));
  CallableTester<Exception> callTester = new CallableTester<>(exceptions);
  BackOff backoff = new RetryBoundedBackOff(3, new BackOffTester());
  IllegalArgumentException thrown =
      assertThrows(
          IllegalArgumentException.class,
          () ->
              ResilientOperation.retry(
                  callTester, backoff, RetryDeterminer.DEFAULT, Exception.class, sleeper));
  assertThat(thrown).hasMessageThat().contains("FakeException");
  assertThat(callTester.timesCalled()).isEqualTo(1);
  verifySleeper(sleeper, 0);
}