TimeoutRepository { public static void setTimeout(Timeout timeout) { TIMEOUTS.setTimeout(Objects.requireNonNull(timeout, "The timeout can't be null.")); }  static Timeout getTimeout(String key); static void setTimeout(Timeout timeout); static void setAllCalibrationTimeouts(HashMap<String, CalibrationTimeout> calibrationTimeouts); static final Timeouts TIMEOUTS; }
@Test public void testSetTimeout() throws Exception { Timeout timeout = new Timeout("ode_v", "service", 20_000, 5_000); TimeoutRepository.setTimeout(timeout); assertEquals("The timeouts in ms should be equal.", timeout.getTimeoutInMs(), TimeoutRepository.getTimeout(timeout.getKey()).getTimeoutInMs()); assertEquals("The timeToRepetitions in ms should be equal.", timeout.getTimeToRepetitionInMs(), TimeoutRepository.getTimeout(timeout.getKey()).getTimeToRepetitionInMs()); }