AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { public CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext context) { if (restorableStatus == null) { String message = this.getClass().getSimpleName() + "restorableStatus status is null"; throw new IllegalStateException(message); } return setCurrentContext(context); } protected  AbstractScenarioGridCommand(final GridWidget gridWidget); protected  AbstractScenarioGridCommand(); @Override CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context); @Override CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context); CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext context); Optional<CommandResult<ScenarioSimulationViolation>> commonUndoRedoPreexecution(final ScenarioSimulationContext context);  }
@Test(expected = IllegalStateException.class) public void redoWithoutRestorable() { commandSpy.restorableStatus = null; commandSpy.redo(scenarioSimulationContextLocal); }