### Question:
Character implements Prototype { public String name() { return name; } Character();  Character(Type type, Prototype prototype);  Character(String name, Character prototype); String name(); Type type(); @Override Integer get(Stats stat); @Override boolean has(Stats stat); @Override void set(Stats stat, Integer val); @Override void remove(Stats stat); @Override String toString();  }### Answer:
@Test public void testName() { final Character prototype = new Character(); prototype.set(Stats.ARMOR, 1); prototype.set(Stats.INTELLECT, 2); assertNull(prototype.name()); final Character stupid = new Character(Type.ROGUE, prototype); stupid.remove(Stats.INTELLECT); assertNull(stupid.name()); final Character weak = new Character("weak", prototype); weak.remove(Stats.ARMOR); assertEquals("weak", weak.name()); }
@Test public void testName() { final var prototype = new Character(); prototype.set(Stats.ARMOR, 1); prototype.set(Stats.INTELLECT, 2); assertNull(prototype.name()); final var stupid = new Character(Type.ROGUE, prototype); stupid.remove(Stats.INTELLECT); assertNull(stupid.name()); final var weak = new Character("weak", prototype); weak.remove(Stats.ARMOR); assertEquals("weak", weak.name()); }
@Test public void testName() throws Exception { final Character prototype = new Character(); prototype.set(Stats.ARMOR, 1); prototype.set(Stats.INTELLECT, 2); assertNull(prototype.name()); final Character stupid = new Character(Type.ROGUE, prototype); stupid.remove(Stats.INTELLECT); assertNull(stupid.name()); final Character weak = new Character("weak", prototype); weak.remove(Stats.ARMOR); assertEquals("weak", weak.name()); }