### Question:
WizardTowerProxy implements WizardTower { @Override public void enter(Wizard wizard) { if (numWizards < NUM_WIZARDS_ALLOWED) { tower.enter(wizard); numWizards++; } else { LOGGER.info("{} is not allowed to enter!", wizard); } } WizardTowerProxy(WizardTower tower); @Override void enter(Wizard wizard);  }### Answer:
@Test public void testEnter() throws Exception { final var wizards = List.of( new Wizard("Gandalf"), new Wizard("Dumbledore"), new Wizard("Oz"), new Wizard("Merlin") ); final var proxy = new WizardTowerProxy(new IvoryTower()); wizards.forEach(proxy::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 is not allowed to enter!")); 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") }; final WizardTowerProxy proxy = new WizardTowerProxy(new IvoryTower()); for (Wizard wizard : wizards) { proxy.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 is not allowed to enter!")); assertEquals(4, appender.getLogSize()); }