SiteGeneralHandler extends AbstractSiteHandler { public TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTab, HttpServletRequest req, HttpServletResponse res, Object comm, BindException errors) { TabbedModelAndView tmav = tc.new TabbedModelAndView(); Site aSite = getEditorContext(req).getSite(); aSite.sortAnnotations(); tmav.addObject(Constants.GBL_CMD_DATA, SiteCommand.buildFromModel(aSite)); return tmav; }  void processTab(TabbedController tc, Tab currentTab, HttpServletRequest req,
			HttpServletResponse res, Object comm, BindException errors); TabbedModelAndView preProcessNextTab(TabbedController tc, Tab nextTab,
			HttpServletRequest req, HttpServletResponse res, Object comm,
			BindException errors); ModelAndView processOther(TabbedController tc, Tab currentTab, HttpServletRequest req,
			HttpServletResponse res, Object comm, BindException errors); void bindEditorContext(HttpServletRequest req, SiteEditorContext context); void setSiteManager(SiteManager siteManager);  }
@Test public final void testPreProcessNextTab() { try { HttpServletRequest aReq = new MockHttpServletRequest(); SiteManager siteManager = new MockSiteManagerImpl(testFile); testInstance.setSiteManager(siteManager); Site site = siteManager.getSite(9000L, true); List<Annotation> list = createAnnotationList(); assertFalse(checkSortedList(list)); site.setAnnotations(list); SiteEditorContext ctx = new SiteEditorContext(site); aReq.getSession().setAttribute(SiteController.EDITOR_CONTEXT, ctx); HttpServletResponse aResp = new MockHttpServletResponse(); SiteCommand aCmd = new SiteCommand(); TabbedController tc = new SiteController(); TabConfig tabConfig = new TabConfig(); tabConfig.setViewName("site"); List<Tab> tabs = getTabList(siteManager); tabConfig.setTabs(tabs); tc.setTabConfig(tabConfig); Tab currentTab = tabs.get(0); BindException aErrors = new BindException(aCmd, aCmd.getCmdAction()); ModelAndView mav = testInstance.preProcessNextTab(tc, currentTab, aReq, aResp, aCmd, aErrors); assertNotNull(mav); assertTrue(checkSortedList(site.getAnnotations())); } catch(Exception e) { fail(e.getMessage()); } }