### Question:
ChaosScheduler implements Scheduler { @Override public Instant getNextChaosTime () { if (nextChaosTime != null) return nextChaosTime; if (lastChaosTime != null) return calculateNextChaosTime(); return calculateFirstChaosTime(); }  static ChaosSchedulerBuilder builder(); @Override Instant getNextChaosTime(); @Override void startExperiment();  }### Answer:
@Test public void getNextChaosTime () { final long Millis1 = 11240648L; final double Gauss1 = 0D; doReturn(Gauss1).when(random).nextGaussian(); doReturn(now.plusMillis(Millis1)).when(holidayManager).getInstantAfterWorkingMillis(any(Instant.class), eq(Millis1)); assertEquals(now.plusMillis(Millis1), scheduler.getNextChaosTime()); verify(holidayManager, times(1)).getInstantAfterWorkingMillis(any(Instant.class), eq(Millis1)); assertEquals(now.plusMillis(Millis1), scheduler.getNextChaosTime()); }
@Test public void testScalingFactorBoundaries () { doReturn(-1D, 2 * Math.sqrt(2) - 0.9, 0D).when(random).nextGaussian(); scheduler.getNextChaosTime(); verify(random, times(3)).nextGaussian(); }