@Test public void testClone() { final MusicalInstrument clone = (MusicalInstrument) instrument1.clone(); assertEquals(instrument1.amount, clone.amount); assertEquals(instrument1.properties, clone.properties); assertNotSame(instrument1, clone); final MusicalInstrument clone2 = (MusicalInstrument) instrument2.clone(); assertEquals(instrument2.amount, clone2.amount); assertEquals(instrument2.properties, clone2.properties); assertNotSame(instrument2, clone2); }
@Override public Item clone() { return new MusicalInstrument((MusicalInstrumentProperties) properties, amount); }
MusicalInstrument extends AbstractItem { @Override public Item clone() { return new MusicalInstrument((MusicalInstrumentProperties) properties, amount); } }
MusicalInstrument extends AbstractItem { @Override public Item clone() { return new MusicalInstrument((MusicalInstrumentProperties) properties, amount); } MusicalInstrument(MusicalInstrumentProperties properties, int amount); }
MusicalInstrument extends AbstractItem { @Override public Item clone() { return new MusicalInstrument((MusicalInstrumentProperties) properties, amount); } MusicalInstrument(MusicalInstrumentProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getSoundToPlay(); }
MusicalInstrument extends AbstractItem { @Override public Item clone() { return new MusicalInstrument((MusicalInstrumentProperties) properties, amount); } MusicalInstrument(MusicalInstrumentProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getSoundToPlay();  }