### Question:
AbstractOperationPM extends AbstractPM implements IOperationPM { public boolean isEnabled() { return this.isValid(); } protected  AbstractOperationPM(); void setIcon(Icon newIcon); Icon getIcon(); void setIconUrl(URL url); String getTitle(); void setTitle(String title); String getDescription(); void setDescription(String description); abstract boolean execute(); boolean isEnabled(); void check();  }### Answer:
@Test public void validateInsideCell() throws Throwable { class MyModel extends AbstractPM { AbstractOperationPM op = util.createAbstractOperation(); final TextPM t = new TextPM(); public MyModel() { PMManager.setup(this); } } final MyModel model = new MyModel(); model.op.getValidator().add(new ValidationRule() { public ValidationState validate() { if (model.t.getText().equals("open sesame")) { return null; } else { return new ValidationState("type in 'open sesame'"); } } }); assertEquals("op.isEnabled()", false, model.op.isEnabled()); model.t.setText("open sesame"); assertEquals("op.isEnabled()", true, model.op.isEnabled()); }
@Test public void validate() throws Throwable { AbstractOperationPM op = util.createAbstractOperation(); op.getValidator().add(new ValidationRule() { public ValidationState validate() { return new ValidationState("give up"); } }); assertEquals("op.isEnabled()", false, op.isEnabled()); }