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