@Test public void testClone() { final Food clone = (Food) food1.clone(); assertEquals(food1.amount, clone.amount); assertEquals(food1.properties, clone.properties); assertNotSame(food1, clone); final Food clone2 = (Food) food2.clone(); assertEquals(food2.amount, clone2.amount); assertEquals(food2.properties, clone2.properties); assertNotSame(food2, clone2); }
@Override public Item clone() { return new Food((StatModifyingItemProperties) properties, amount); }
Food extends ConsumableItem { @Override public Item clone() { return new Food((StatModifyingItemProperties) properties, amount); } }
Food extends ConsumableItem { @Override public Item clone() { return new Food((StatModifyingItemProperties) properties, amount); } Food(StatModifyingItemProperties properties, int amount); }
Food extends ConsumableItem { @Override public Item clone() { return new Food((StatModifyingItemProperties) properties, amount); } Food(StatModifyingItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getMinHun(); int getMaxHun(); }
Food extends ConsumableItem { @Override public Item clone() { return new Food((StatModifyingItemProperties) properties, amount); } Food(StatModifyingItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getMinHun(); int getMaxHun();  }