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