@Test public void testClone() { final Mineral clone = (Mineral) mineral1.clone(); assertEquals(mineral1.amount, clone.amount); assertEquals(mineral1.properties, clone.properties); assertNotSame(mineral1, clone); final Mineral clone2 = (Mineral) mineral2.clone(); assertEquals(mineral2.amount, clone2.amount); assertEquals(mineral2.properties, clone2.properties); assertNotSame(mineral2, clone2); }
@Override public Item clone() { return new Mineral((ItemProperties) properties, amount); }
Mineral extends AbstractItem { @Override public Item clone() { return new Mineral((ItemProperties) properties, amount); } }
Mineral extends AbstractItem { @Override public Item clone() { return new Mineral((ItemProperties) properties, amount); } Mineral(ItemProperties properties, int amount); }
Mineral extends AbstractItem { @Override public Item clone() { return new Mineral((ItemProperties) properties, amount); } Mineral(ItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character); }
Mineral extends AbstractItem { @Override public Item clone() { return new Mineral((ItemProperties) properties, amount); } Mineral(ItemProperties properties, int amount); @Override Item clone(); @Override void use(Character character);  }