@Test public void testClone() { final Boat clone = (Boat) boat1.clone(); assertEquals(boat1.amount, clone.amount); assertEquals(boat1.properties, clone.properties); assertNotSame(boat1, clone); final Boat clone2 = (Boat) boat2.clone(); assertEquals(boat2.amount, clone2.amount); assertEquals(boat2.properties, clone2.properties); assertNotSame(boat2, clone2); }
@Override public Item clone() { return new Boat((BoatProperties) properties, amount); }
Boat extends AbstractDefensiveItem { @Override public Item clone() { return new Boat((BoatProperties) properties, amount); } }
Boat extends AbstractDefensiveItem { @Override public Item clone() { return new Boat((BoatProperties) properties, amount); } Boat(BoatProperties properties, int amount); }
Boat extends AbstractDefensiveItem { @Override public Item clone() { return new Boat((BoatProperties) properties, amount); } Boat(BoatProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getMinHit(); int getMaxHit(); int getDamageBonus(); @Override boolean canBeStolen(); int getUsageDifficulty(); }
Boat extends AbstractDefensiveItem { @Override public Item clone() { return new Boat((BoatProperties) properties, amount); } Boat(BoatProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getMinHit(); int getMaxHit(); int getDamageBonus(); @Override boolean canBeStolen(); int getUsageDifficulty();  }