@Test public void testSetHealth() { final GiantModel model = new GiantModel(Health.HEALTHY, Fatigue.ALERT, Nourishment.SATURATED); assertEquals(Health.HEALTHY, model.getHealth()); for (final Health health : Health.values()) { model.setHealth(health); assertEquals(health, model.getHealth()); assertEquals("The giant looks " + health.toString() + ", alert and saturated.", model.toString()); } }
public void setHealth(Health health) { this.health = health; }
GiantModel { public void setHealth(Health health) { this.health = health; } }
GiantModel { public void setHealth(Health health) { this.health = health; } GiantModel(Health health, Fatigue fatigue, Nourishment nourishment); }
GiantModel { public void setHealth(Health health) { this.health = health; } GiantModel(Health health, Fatigue fatigue, Nourishment nourishment); Health getHealth(); void setHealth(Health health); Fatigue getFatigue(); void setFatigue(Fatigue fatigue); Nourishment getNourishment(); void setNourishment(Nourishment nourishment); @Override String toString(); }
GiantModel { public void setHealth(Health health) { this.health = health; } GiantModel(Health health, Fatigue fatigue, Nourishment nourishment); Health getHealth(); void setHealth(Health health); Fatigue getFatigue(); void setFatigue(Fatigue fatigue); Nourishment getNourishment(); void setNourishment(Nourishment nourishment); @Override String toString();  }