### Question:
UserController { @RequestMapping(method = RequestMethod.GET, value = {"/admin/adduser"}) public String setUpForm(ModelMap model, @RequestParam(required = false) String referringPageId) { logger.debug("Initializing new account form"); model.addAttribute(ModelKeys.REFERRING_PAGE_ID, referringPageId); AdminControllerUtil.addNavigationMenusToModel(SELECTED_ITEM, (Model) model, referringPageId); model.addAttribute(ModelKeys.NEW_USER, new UserImpl()); return ViewNames.ADMIN_NEW_ACCOUNT; }  @InitBinder(value = {"user"}) void initBinder(WebDataBinder dataBinder); @RequestMapping(value = {"/admin/users"}, method = RequestMethod.GET) String viewUsers(@RequestParam(required = false, defaultValue = "0") int offset,
                            @RequestParam(required = false) final String action,
                            @RequestParam(required = false) String referringPageId,
                            Model model); @RequestMapping(value = "/admin/users/search", method = RequestMethod.GET) String searchUsers(@RequestParam(required = true) String searchTerm,
                              @RequestParam(required = false, defaultValue = "0") int offset,
                              @RequestParam(required = false) String referringPageId,Model model); @RequestMapping(value = "/admin/userdetail/{userid}", method = RequestMethod.GET) String viewUserDetail(@PathVariable("userid") String userid,
                                 @RequestParam(required = false) String referringPageId,
                                 Model model); @RequestMapping(value = "/admin/userdetail/update", method = RequestMethod.POST) String updateUserDetail(@ModelAttribute User user, BindingResult result,
                                   @ModelAttribute(ModelKeys.TOKENCHECK) String sessionToken,
                                   @RequestParam() String token,
                                   @RequestParam(required = false) String referringPageId,
                                   ModelMap modelMap,
                                   SessionStatus status); @RequestMapping(value = "/admin/userdetail/delete", method = RequestMethod.POST) String deleteUserDetail(@ModelAttribute User user,
                                   @ModelAttribute(ModelKeys.TOKENCHECK) String sessionToken,
                                   @RequestParam String token,
                                   @RequestParam(required = false) String confirmdelete,
                                   @RequestParam(required = false) String referringPageId,
                                   ModelMap modelMap,
                                   SessionStatus status); @RequestMapping(method = RequestMethod.GET, value = {"/admin/adduser"}) String setUpForm(ModelMap model, @RequestParam(required = false) String referringPageId); @RequestMapping(value = {"/admin/newaccount", "/admin/newaccount/*"}, method = RequestMethod.POST) String create(@ModelAttribute(value = "newUser") UserForm newUser, BindingResult results, Model model,
                         @RequestParam(required = false) String referringPageId,
                         RedirectAttributes redirectAttributes); @ModelAttribute("authorities") SearchResult<Authority> populateAuthorityList(); @ModelAttribute("loggedInUser") String populateLoggedInUsername(); int getPageSize();  }### Answer:
@Test public void setupForm() { ModelMap modelMap = new ExtendedModelMap(); final String viewName = controller.setUpForm(modelMap,REFERRER_ID); assertEquals(ViewNames.ADMIN_NEW_ACCOUNT, viewName); assertTrue(modelMap.containsAttribute(TABS)); assertTrue(modelMap.get(ModelKeys.NEW_USER) instanceof UserImpl); assertThat((String) modelMap.get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID))); }