### Question:
ApplicationModel { public List<Menu> getMenuList() throws SearchException, ApplicationPageNotFoundException { return factory.create(applicationApi.searchApplicationMenus(new SearchOptionsBuilder(0, Integer.MAX_VALUE) .filter(ApplicationMenuSearchDescriptor.APPLICATION_ID, application.getId()) .sort(ApplicationMenuSearchDescriptor.INDEX, Order.ASC).done()) .getResult()); } ApplicationModel(
            final ApplicationAPI applicationApi,
            final PageAPI pageApi,
            final ProfileAPI profileApi,
            final Application application,
            final MenuFactory factory); long getId(); String getApplicationLayoutName(); String getApplicationThemeName(); Long getApplicationThemeId(); String getApplicationHomePage(); boolean hasPage(final String pageToken); boolean authorize(final APISession session); boolean hasProfileMapped(); Page getCustomPage(final String pageToken); List<Menu> getMenuList();  }### Answer:
@Test public void should_sort_application_menu_search() throws Exception { givenSearchApplicationMenusWillReturns(Collections.<ApplicationMenu> emptyList()); model.getMenuList(); final ArgumentCaptor<SearchOptions> captor = ArgumentCaptor.forClass(SearchOptions.class); verify(applicationApi).searchApplicationMenus(captor.capture()); final Sort sort = captor.getValue().getSorts().get(0); assertThat(sort.getField()).isEqualTo(ApplicationMenuSearchDescriptor.INDEX); assertThat(sort.getOrder()).isEqualTo(Order.ASC); }
@Test public void should_create_menu_using_menuList() throws Exception { final List<ApplicationMenu> menuList = Arrays.<ApplicationMenu> asList(new ApplicationMenuImpl("name", 1L, 2L, 1)); givenSearchApplicationMenusWillReturns(menuList); model.getMenuList(); verify(factory).create(menuList); }