@Test public void testClone() { final EmptyBottle clone = (EmptyBottle) bottle1.clone(); assertEquals(bottle1.amount, clone.amount); assertEquals(bottle1.properties, clone.properties); assertNotSame(bottle1, clone); final EmptyBottle clone2 = (EmptyBottle) bottle2.clone(); assertEquals(bottle2.amount, clone2.amount); assertEquals(bottle2.properties, clone2.properties); assertNotSame(bottle2, clone2); }
@Override public Item clone() { return new EmptyBottle((RefillableStatModifyingItemProperties) properties, amount); }
EmptyBottle extends AbstractItem { @Override public Item clone() { return new EmptyBottle((RefillableStatModifyingItemProperties) properties, amount); } }
EmptyBottle extends AbstractItem { @Override public Item clone() { return new EmptyBottle((RefillableStatModifyingItemProperties) properties, amount); } EmptyBottle(RefillableStatModifyingItemProperties properties, int amount); }
EmptyBottle extends AbstractItem { @Override public Item clone() { return new EmptyBottle((RefillableStatModifyingItemProperties) properties, amount); } EmptyBottle(RefillableStatModifyingItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); }
EmptyBottle extends AbstractItem { @Override public Item clone() { return new EmptyBottle((RefillableStatModifyingItemProperties) properties, amount); } EmptyBottle(RefillableStatModifyingItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character);  }