public void timePasses() {
    var enumValues = WeatherType.values();
    currentWeather = enumValues[(currentWeather.ordinal() + 1) % enumValues.length];
    LOGGER.info("The weather changed to {}.", currentWeather);
    notifyObservers();
  }
@Test
  void testTimePasses() {
    final var observer = mock(WeatherObserver.class);
    final var weather = new Weather();
    weather.addObserver(observer);

    final var inOrder = inOrder(observer);
    final var weatherTypes = WeatherType.values();
    for (var i = 1; i < 20; i++) {
      weather.timePasses();
      inOrder.verify(observer).update(weatherTypes[i % weatherTypes.length]);
    }

    verifyNoMoreInteractions(observer);
  }