@Test
public void shouldScheduleRetryOnNonZero() {

  StateData data = data(1, 1.0, Optional.of(1));
  RunState nonZeroTerm = RunState.create(WORKFLOW_INSTANCE, TERMINATED, data, NOW, COUNTER);
  Duration expectedDelay = Duration.ofMillis(4711);
  when(retryUtil.calculateDelay(anyInt())).thenReturn(expectedDelay);
  terminationHandler.transitionInto(nonZeroTerm, eventRouter);
  verify(eventRouter).receiveIgnoreClosed(Event.retryAfter(WORKFLOW_INSTANCE, expectedDelay.toMillis()), COUNTER);
}