@Test public void testGetSounds() { for (int i = 0; i < ATTEMPTS; i++) { assertTrue(sounds1.contains(instrument1.getSoundToPlay())); } assertEquals(sounds2.get(0), (Integer) instrument2.getSoundToPlay()); }
public int getSoundToPlay() { List<Integer> sounds = ((MusicalInstrumentProperties) properties).getSounds(); return sounds.get((int) Math.floor(Math.random() * sounds.size())); }
MusicalInstrument extends AbstractItem { public int getSoundToPlay() { List<Integer> sounds = ((MusicalInstrumentProperties) properties).getSounds(); return sounds.get((int) Math.floor(Math.random() * sounds.size())); } }
MusicalInstrument extends AbstractItem { public int getSoundToPlay() { List<Integer> sounds = ((MusicalInstrumentProperties) properties).getSounds(); return sounds.get((int) Math.floor(Math.random() * sounds.size())); } MusicalInstrument(MusicalInstrumentProperties properties, int amount); }
MusicalInstrument extends AbstractItem { public int getSoundToPlay() { List<Integer> sounds = ((MusicalInstrumentProperties) properties).getSounds(); return sounds.get((int) Math.floor(Math.random() * sounds.size())); } MusicalInstrument(MusicalInstrumentProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getSoundToPlay(); }
MusicalInstrument extends AbstractItem { public int getSoundToPlay() { List<Integer> sounds = ((MusicalInstrumentProperties) properties).getSounds(); return sounds.get((int) Math.floor(Math.random() * sounds.size())); } MusicalInstrument(MusicalInstrumentProperties properties, int amount); @Override Item clone(); @Override void use(Character character); int getSoundToPlay();  }