### Question:
PersonController { @RequestMapping(method=RequestMethod.GET,value="edit") public ModelAndView editPerson(@RequestParam(value="id",required=false) Long id) { logger.debug("Received request to edit person id : "+id); ModelAndView mav = new ModelAndView(); mav.setViewName("edit"); Person person = null; if (id == null) { person = new Person(); } else { person = personDao.find(id); } mav.addObject("person", person); 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 shouldReturnSecondPersonWithEditMav() { Long template = dataInitializer.getPeople().get(1); ModelAndView mav = personController.editPerson(template); assertNotNull(mav); assertEquals("edit", mav.getViewName()); Object object = mav.getModel().get("person"); assertTrue(Person.class.isAssignableFrom(object.getClass())); Person person = (Person) object; assertEquals(template,person.getId()); }