public void testShouldSwitchItemPageBackAndForth() {
Mock catalogServiceMock = mock(CatalogService.class);
CatalogBean bean = new CatalogBean((CatalogService) catalogServiceMock.proxy());
PaginatedList itemList = new PaginatedArrayList(2);
itemList.add(new Item());
itemList.add(new Item());
itemList.add(new Item());
itemList.add(new Item());
itemList.add(new Item());
bean.setItemList(itemList);
bean.setPageDirection("next");
assertEquals(AbstractBean.SUCCESS, bean.switchItemListPage());
assertEquals(1, itemList.getPageIndex());