### Question:
Dashboard extends VerticalLayout { public void setPage(int pageId) { pageContentArea.setSelectedTab(pageId); } Dashboard(AbstractRainbowVaadinUI rui); void addPage(String pageName); void setPage(int pageId); void removePage(int pageId); void loadViewConfiguration(); void saveViewConfiguration(); void resetDashboard();  }### Answer:
@Test public void setPage() { for (int i = 0; i < 5; i++) { dashboard.newPageBtn.click(); dashboard.txtPageName.setValue("Test" + i); dashboard.btnCreate.click(); } assertEquals(dashboard.tabs.size(), 6); dashboard.setPage(3); assertEquals( dashboard.pageContentArea.getTab( dashboard.pageContentArea.getSelectedTab()) .getCaption(), "Test2"); }
@Test public void setPageOutsideBouds() { for (int i = 0; i < 5; i++) { dashboard.newPageBtn.click(); dashboard.txtPageName.setValue("Test" + i); dashboard.btnCreate.click(); } assertEquals(dashboard.tabs.size(), 6); dashboard.setPage(3); assertEquals( dashboard.pageContentArea.getTab( dashboard.pageContentArea.getSelectedTab()) .getCaption(), "Test2"); dashboard.setPage(10); assertEquals( dashboard.pageContentArea.getTab( dashboard.pageContentArea.getSelectedTab()) .getCaption(), "Test2"); dashboard.setPage(-1); assertEquals( dashboard.pageContentArea.getTab( dashboard.pageContentArea.getSelectedTab()) .getCaption(), "Test2"); }