@Test public void testClone() { final Drink clone = (Drink) drink1.clone(); assertEquals(drink1.amount, clone.amount); assertEquals(drink1.properties, clone.properties); assertNotSame(drink1, clone); final Drink clone2 = (Drink) drink2.clone(); assertEquals(drink2.amount, clone2.amount); assertEquals(drink2.properties, clone2.properties); assertNotSame(drink2, clone2); }
@Override public Item clone() { return new Drink((StatModifyingItemProperties) properties, amount); }
Drink extends ConsumableItem { @Override public Item clone() { return new Drink((StatModifyingItemProperties) properties, amount); } }
Drink extends ConsumableItem { @Override public Item clone() { return new Drink((StatModifyingItemProperties) properties, amount); } Drink(StatModifyingItemProperties properties, int amount); }
Drink extends ConsumableItem { @Override public Item clone() { return new Drink((StatModifyingItemProperties) properties, amount); } Drink(StatModifyingItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getMinThirst(); int getMaxThirst(); }
Drink extends ConsumableItem { @Override public Item clone() { return new Drink((StatModifyingItemProperties) properties, amount); } Drink(StatModifyingItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getMinThirst(); int getMaxThirst();  }