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