void (@Nullable Consumer<? super Step> adjuster) { while (true) { ModuleWizardStep currentStep = myWizard.getCurrentStepObject(); if (adjuster != null) { try { adjuster.accept(currentStep); } catch (CancelWizardException e) { myWizard.doCancelAction(); return; } } if (myWizard.isLast()) { break; } myWizard.doNextAction(); if (currentStep == myWizard.getCurrentStepObject()) { throw new RuntimeException(currentStep + " is not validated"); } } if (!myWizard.doFinishAction()) { throw new RuntimeException(myWizard.getCurrentStepObject() + " is not validated"); } }