### Question:
Wizard { @Override public String toString() { return name; } Wizard(String name); @Override String toString();  }### Answer:
@Test public void testToString() { List.of("Gandalf", "Dumbledore", "Oz", "Merlin") .forEach(name -> assertEquals(name, new Wizard(name).toString())); }
@Test public void testToString() throws Exception { final String[] wizardNames = {"Gandalf", "Dumbledore", "Oz", "Merlin"}; for (String name : wizardNames) { assertEquals(name, new Wizard(name).toString()); } }
@Test public void testToString() throws Exception { final String[] wizardNames = {"Gandalf", "Dumbledore", "Oz", "Merlin"}; for (final String name : wizardNames) { assertEquals(name, new Wizard(name).toString()); } }