### Question:
PersonController { @RequestMapping(method=RequestMethod.GET,value="list") public ModelAndView listPeople() { logger.debug("Received request to list persons"); myScopeBean.validateReferences(); ModelAndView mav = new ModelAndView(); List<Person> people = personDao.getPeople(); logger.debug("Person Listing count = "+people.size()); mav.addObject("people",people); mav.setViewName("list"); return mav; }  @RequestMapping(method=RequestMethod.GET,value="edit") ModelAndView editPerson(@RequestParam(value="id",required=false) Long id); @RequestMapping(method=RequestMethod.POST,value="edit") String savePerson(@ModelAttribute Person person); @RequestMapping(method=RequestMethod.GET,value="list") ModelAndView listPeople();  }### Answer:
@Test public void shouldReturnPersonListView() { ModelAndView mav = personController.listPeople(); assertEquals("list",mav.getViewName()); @SuppressWarnings("unchecked") List<Person> people = (List<Person>) mav.getModelMap().get("people"); assertNotNull(people); assertEquals(DataInitializer.PERSON_COUNT,people.size()); }