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