### Question:
PopulationManager implements PopulationDAO { @Override public Population findByName(String populationName) { List<Population> populations = watcher.getParsedData(); if(populations != null) { Iterator<Population> it = populations.iterator(); while( it.hasNext() ) { Population cur = it.next(); if(cur.getName() != null && cur.getName().equals(populationName)) { return cur; } } } return null; }  @PostConstruct void init(); @Override Population save(Population population); @Override void delete(Population population); @Override Population findByName(String populationName); @Override Population getDefaultPopulation(); @Override List<Population> listPopulations();  }### Answer:
@Test public void testFindByName() { Population defaultPopulation = popDao.getDefaultPopulation(); assertNotNull(defaultPopulation); assertEquals(Population.NAME_GENERAL, defaultPopulation.getName()); Population curPop = popDao.findByName(expectedPopulationName); if(exist) { assertNotNull(curPop); if(isDefault) { assertEquals(defaultPopulation.getName(), curPop.getName()); }else{ assertNotEquals(defaultPopulation.getName(), curPop.getName()); } assertEquals(expectedMinHubV2Version, curPop.getMinHubV2Version()); assertEquals(expectedMinHubV3Version, curPop.getMinHubV3Version()); }else{ assertNull(curPop); } }