### Question:
DefaultWizardStepListModel implements WizardStepListModel { @Override public boolean allStepsAreValid() { for (int index = 0; index < myStepStates.size(); ++index) { if (myStepStates.get(index) != StepState.VALID && myStepStates.get(index) != StepState.WARNING) { return false; } } return true; } DefaultWizardStepListModel(List<? extends String> stepTitles, int initialStep);  DefaultWizardStepListModel(List<? extends String> stepTitles, String initialStepTitle); @Override boolean allStepsAreValid(); @Override void decrementStep(); @Override ChangeSupport<WizardStepListModelChangeListener> getChangeSupport(); @Override int getCurrentStep(); @Override String getCurrentStepTitle(); @Override final int getStepCount(); @Override StepState getStepState(int step); @Override StepState getStepState(String stepTitle); @Override String getStepTitle(int index); @Override List<? extends String> getStepTitles(); @Override void incrementStep(); @Override final void setCurrentStep(int step); @Override final void setCurrentStep(String stepTitle); @Override void refreshCurrentStep(); @Override void setStepState(int step, StepState state); @Override void setStepState(String stepTitle, StepState state);  }### Answer:
@Test public void testAllStepsAreValid() { List<? extends String> steps = Arrays.asList(STEP1, STEP2, STEP3); DefaultWizardStepListModel model = new DefaultWizardStepListModel(steps, 0); Assert.assertFalse(model.allStepsAreValid()); model.setStepState(0, StepState.VALID); Assert.assertFalse(model.allStepsAreValid()); model.setStepState(1, StepState.VALID); Assert.assertFalse(model.allStepsAreValid()); model.setStepState(2, StepState.VALID); Assert.assertTrue(model.allStepsAreValid()); for (StepState state : EnumSet.complementOf(EnumSet.of(StepState.VALID))) { for (int index = 0; index < steps.size(); ++index) { model.setStepState(index, state); if (state != StepState.WARNING) { Assert.assertFalse(model.allStepsAreValid()); } else { Assert.assertTrue(model.allStepsAreValid()); } model.setStepState(index, StepState.VALID); Assert.assertTrue(model.allStepsAreValid()); } } }