FixedDelayRestartStrategy implements RestartStrategy { public FixedDelayRestartStrategy( int maxNumberRestartAttempts, long delayBetweenRestartAttempts) { Preconditions.checkArgument(maxNumberRestartAttempts >= 0, "Maximum number of restart attempts must be positive."); Preconditions.checkArgument(delayBetweenRestartAttempts >= 0, "Delay between restart attempts must be positive"); this.maxNumberRestartAttempts = maxNumberRestartAttempts; this.delayBetweenRestartAttempts = delayBetweenRestartAttempts; currentRestartAttempt = 0; } FixedDelayRestartStrategy(
		int maxNumberRestartAttempts,
		long delayBetweenRestartAttempts); int getCurrentRestartAttempt(); @Override boolean canRestart(); @Override void restart(final ExecutionGraph executionGraph); static FixedDelayRestartStrategy create(Configuration configuration); @Override String toString();  }
@Test public void testFixedDelayRestartStrategy() { int numberRestarts = 10; long restartDelay = 10; FixedDelayRestartStrategy fixedDelayRestartStrategy = new FixedDelayRestartStrategy( numberRestarts, restartDelay); ExecutionGraph executionGraph = mock(ExecutionGraph.class); when(executionGraph.getExecutionContext()) .thenReturn(ExecutionContext$.MODULE$.fromExecutor(MoreExecutors.directExecutor())); while(fixedDelayRestartStrategy.canRestart()) { fixedDelayRestartStrategy.restart(executionGraph); } Mockito.verify(executionGraph, Mockito.times(numberRestarts)).restart(); }