### Question:
DefaultWizardRules implements WizardRules { @Override public boolean canFinish() { return myStepModel.allStepsAreValid(); } DefaultWizardRules(WizardStepListModel stepModel); @Override boolean canFinish(); @Override boolean canGoNext(); @Override boolean canGoPrevious();  }### Answer:
@Test public void testCanFinish() { WizardStepListModel stepModel = EasyMock.createMock(WizardStepListModel.class); EasyMock.expect(Boolean.valueOf(stepModel.allStepsAreValid())).andReturn(Boolean.TRUE); EasyMock.replay(stepModel); Assert.assertTrue(new DefaultWizardRules(stepModel).canFinish()); EasyMock.reset(stepModel); EasyMock.expect(Boolean.valueOf(stepModel.allStepsAreValid())).andReturn(Boolean.FALSE); EasyMock.replay(stepModel); Assert.assertFalse(new DefaultWizardRules(stepModel).canFinish()); }