@Test void next() { Wizard wizard = new Wizard(); WizardPage p1 = new TestWizardPage(); wizard.addPage(p1); WizardPage p2 = new TestWizardPage(); wizard.addPage(p2); assertEquals(p1, wizard.getCurrentPage()); wizard.next(); assertEquals(p2, wizard.getCurrentPage()); }
public void next() { if (isLastPage()) { throw new IllegalStateException("There is no next page"); } currentPageIndex++; }
Wizard implements Serializable { public void next() { if (isLastPage()) { throw new IllegalStateException("There is no next page"); } currentPageIndex++; } }
Wizard implements Serializable { public void next() { if (isLastPage()) { throw new IllegalStateException("There is no next page"); } currentPageIndex++; }  }
Wizard implements Serializable { public void next() { if (isLastPage()) { throw new IllegalStateException("There is no next page"); } currentPageIndex++; }  void addPage(WizardPage page); List<WizardPage> getPages(); WizardPage getCurrentPage(); boolean isLastPage(); boolean isFirstPage(); void next(); void previous(); WizardButton getNextButton(); WizardButton getPreviousButton(); }
Wizard implements Serializable { public void next() { if (isLastPage()) { throw new IllegalStateException("There is no next page"); } currentPageIndex++; }  void addPage(WizardPage page); List<WizardPage> getPages(); WizardPage getCurrentPage(); boolean isLastPage(); boolean isFirstPage(); void next(); void previous(); WizardButton getNextButton(); WizardButton getPreviousButton();  }