### Question:
IvoryTower implements WizardTower { public void enter(Wizard wizard) { LOGGER.info("{} enters the tower.", wizard); }  void enter(Wizard wizard);  }### Answer:
@Test public void testEnter() { final var wizards = List.of( new Wizard("Gandalf"), new Wizard("Dumbledore"), new Wizard("Oz"), new Wizard("Merlin") ); var tower = new IvoryTower(); wizards.forEach(tower::enter); assertTrue(appender.logContains("Gandalf enters the tower.")); assertTrue(appender.logContains("Dumbledore enters the tower.")); assertTrue(appender.logContains("Oz enters the tower.")); assertTrue(appender.logContains("Merlin enters the tower.")); assertEquals(4, appender.getLogSize()); }
@Test public void testEnter() throws Exception { final Wizard[] wizards = new Wizard[]{ new Wizard("Gandalf"), new Wizard("Dumbledore"), new Wizard("Oz"), new Wizard("Merlin") }; IvoryTower tower = new IvoryTower(); for (Wizard wizard : wizards) { tower.enter(wizard); } assertTrue(appender.logContains("Gandalf enters the tower.")); assertTrue(appender.logContains("Dumbledore enters the tower.")); assertTrue(appender.logContains("Oz enters the tower.")); assertTrue(appender.logContains("Merlin enters the tower.")); assertEquals(4, appender.getLogSize()); }