@Test public void testClone() { final Wood clone = (Wood) wood1.clone(); assertEquals(wood1.amount, clone.amount); assertEquals(wood1.properties, clone.properties); assertNotSame(wood1, clone); final Wood clone2 = (Wood) wood2.clone(); assertEquals(wood2.amount, clone2.amount); assertEquals(wood2.properties, clone2.properties); assertNotSame(wood2, clone2); }
@Override public Item clone() { return new Wood((WoodProperties) properties, amount); }
Wood extends AbstractItem { @Override public Item clone() { return new Wood((WoodProperties) properties, amount); } }
Wood extends AbstractItem { @Override public Item clone() { return new Wood((WoodProperties) properties, amount); } Wood(WoodProperties properties, int amount); }
Wood extends AbstractItem { @Override public Item clone() { return new Wood((WoodProperties) properties, amount); } Wood(WoodProperties properties, int amount); @Override Item clone(); @Override void use(Character character); WoodType getWoodType(); }
Wood extends AbstractItem { @Override public Item clone() { return new Wood((WoodProperties) properties, amount); } Wood(WoodProperties properties, int amount); @Override Item clone(); @Override void use(Character character); WoodType getWoodType();  }