@Test public void testClone() { final DeathPotion clone = (DeathPotion) potion1.clone(); assertEquals(potion1.amount, clone.amount); assertEquals(potion1.properties, clone.properties); assertNotSame(potion1, clone); final DeathPotion clone2 = (DeathPotion) potion2.clone(); assertEquals(potion2.amount, clone2.amount); assertEquals(potion2.properties, clone2.properties); assertNotSame(potion2, clone2); }
@Override public Item clone() { return new DeathPotion((ItemProperties) properties, amount); }
DeathPotion extends ConsumableItem { @Override public Item clone() { return new DeathPotion((ItemProperties) properties, amount); } }
DeathPotion extends ConsumableItem { @Override public Item clone() { return new DeathPotion((ItemProperties) properties, amount); } DeathPotion(ItemProperties properties, int amount); }
DeathPotion extends ConsumableItem { @Override public Item clone() { return new DeathPotion((ItemProperties) properties, amount); } DeathPotion(ItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); }
DeathPotion extends ConsumableItem { @Override public Item clone() { return new DeathPotion((ItemProperties) properties, amount); } DeathPotion(ItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character);  }