Weather { public void onDeath() { LOGGER.info("Weather {} was Killed", this.name); for (WeatherComponent component : weatherComponents) { component.kill(); } weatherComponents = new ArrayList<>(); } Weather();  Weather(List<String> settings); @Override String toString(); WeatherType weatherType(); Map<String, Integer> getComponents(); Boolean load(List<String> settings); void onDeath(); void replace(WeatherType key, double val); String getPath();  }
@Test public void testOnDeath() { Weather weather = new Weather(); WeatherComponent random = new WeatherComponent("Random"); weather.addComponents(random); Assert.assertTrue(!weather.getComponents().isEmpty()); weather.onDeath(); Assert.assertTrue(weather.getComponents().isEmpty()); }