code: public WizardPage getNextPage(WizardPage page) {
          int index = pages.indexOf(page);
          if (index == pages.size() - 1 || index == -1) {
              // last page or page not found
              return null;
          }
          return (WizardPage)pages.get(index + 1);
      }
docs: {@inheritDoc}