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