ModelWizard implements Disposable { @Override public void dispose() { myBindings.releaseAll(); myWizardListeners.clear(); } private  ModelWizard(@NotNull Collection<ModelWizardStep> steps); @NotNull ObservableBool canGoBack(); @NotNull ObservableBool canGoForward(); @NotNull ObservableBool onLastStep(); @NotNull TitleHeader getTitleHeader(); void setCancelInterceptor(@NotNull BooleanSupplier cancelInterceptor); @Nullable JComponent getPreferredFocusComponent(); @NotNull JPanel getContentPanel(); boolean goForward(); boolean goBack(); void cancel(); void addResultListener(@NotNull WizardListener listener); void removeResultListener(@NotNull WizardListener listener); boolean isFinished(); @Override void dispose();  }
@Test(expected = IllegalStateException.class) public void wizardCantGoBackIfNoPreviousSteps() throws Exception { DummyModel model = new DummyModel(); ModelWizard wizard = new ModelWizard.Builder(new DummyStep(model), new DummyStep(model)).build(); try { runInvokerAndGoForward(wizard); runInvokerAndGoBack(wizard); runInvokerAndGoBack(wizard); } finally { Disposer.dispose(wizard); } }