@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()); }
public String name() { return name; }
Character implements Prototype { public String name() { return name; } }
Character implements Prototype { public String name() { return name; } Character();  Character(Type type, Prototype prototype);  Character(String name, Character prototype); }
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(); }
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();  }