@Test public void testClone() { final Shield clone = (Shield) shield1.clone(); assertEquals(shield1.amount, clone.amount); assertEquals(shield1.properties, clone.properties); assertNotSame(shield1, clone); final Shield clone2 = (Shield) shield2.clone(); assertEquals(shield2.amount, clone2.amount); assertEquals(shield2.properties, clone2.properties); assertNotSame(shield2, clone); }
@Override public Item clone() { return new Shield((DefensiveItemProperties) properties, amount); }
Shield extends AbstractDefensiveItem { @Override public Item clone() { return new Shield((DefensiveItemProperties) properties, amount); } }
Shield extends AbstractDefensiveItem { @Override public Item clone() { return new Shield((DefensiveItemProperties) properties, amount); } Shield(DefensiveItemProperties properties, int amount); }
Shield extends AbstractDefensiveItem { @Override public Item clone() { return new Shield((DefensiveItemProperties) properties, amount); } Shield(DefensiveItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); }
Shield extends AbstractDefensiveItem { @Override public Item clone() { return new Shield((DefensiveItemProperties) properties, amount); } Shield(DefensiveItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character);  }