public void tuneInstrument(MusicInstrument inst) throws MyMusicInstrumentException { if (inst.getName().equals("")) { throw new MyMusicInstrumentException("Exception"); } inst.tune(); }
public ArrayList<String> getNamesOfInstrument() { for (MusicInstrument inst : instruments) { allInstrumentNames.add(inst.getName()); } return allInstrumentNames; }