### Question:
TemplateSelector implements ITemplateSelector { @Override public SynthTemplate chooseRandom() throws Exception { SynthTemplate synthTemplate = null; List<SynthTemplate> templateList = new ArrayList<>(); Iterable<SynthTemplate> synthTemplates = synthTemplateDal.findAll(); synthTemplates.iterator().forEachRemaining(templateList::add); int randomIndex = (new Random()).nextInt(templateList.size()); synthTemplate = templateList.get(randomIndex); return synthTemplate; }  @Override SynthTemplate chooseRandom(); @Override SynthTemplate chooseUniqueRandom(List<Integer> ids); @Override List<SynthTemplate> chooseRandomList(int size); @Override SynthTemplate chooseSpecific(Integer templateId);  }### Answer:
@Test public void shouldSetTemplate() throws Exception { SynthTemplate synthTemplate = templateSelector.chooseRandom(); Assert.assertTrue(synthTemplate.getHiSynthId() != 0); Assert.assertTrue(!synthTemplate.getHiSynthName().equalsIgnoreCase("")); Assert.assertTrue(synthTemplate.getHiSynthIdAlt() != 0); Assert.assertTrue(!synthTemplate.getHiSynthNameAlt().equalsIgnoreCase("")); Assert.assertTrue(synthTemplate.getMidSynthId() != 0); Assert.assertTrue(!synthTemplate.getMidSynthName().equalsIgnoreCase("")); Assert.assertTrue(synthTemplate.getMidSynthIdAlt() != 0); Assert.assertTrue(!synthTemplate.getMidSynthNameAlt().equalsIgnoreCase("")); Assert.assertTrue(synthTemplate.getLowSynthId() != 0); Assert.assertTrue(!synthTemplate.getLowSynthName().equalsIgnoreCase("")); Assert.assertTrue(synthTemplate.getLowSynthIdAlt() != 0); Assert.assertTrue(!synthTemplate.getLowSynthNameAlt().equalsIgnoreCase("")); }