### Question:
AbstractValuePM extends AbstractPM implements IValuePM { public void setMandatory(boolean mandatory) { if (equals(this.mandatory, mandatory)) { return; } boolean old = this.mandatory; this.mandatory = mandatory; revalidate(); getPropertyChangeSupport().firePropertyChange("mandatory", old, mandatory); } protected  AbstractValuePM(); String getDescription(); void setDescription(String description); boolean isMandatory(); void setMandatory(boolean mandatory); String getTitle(); void setTitle(String title); boolean isEditable(); void setEditable(boolean editable); @Override void revalidate();  }### Answer:
@Test public void setMandatory() { AbstractValuePM pM = create(true); pM.setMandatory(true); assertEquals("pM.isMandatory()", true, pM.isMandatory()); pM.setMandatory(false); assertEquals("pM.isMandatory()", false, pM.isMandatory()); }
@Test public void isValid() { AbstractValuePM pM = create(true); pM.setMandatory(true); assertEquals("pM.isValid()", false, pM.isValid()); pM.setMandatory(false); assertEquals("pM.isValid()", true, pM.isValid()); }
@Test public void isValid2() { AbstractValuePM pM = create(true); pM.getValidator().add(new ValidationRule() { public ValidationState validate() { return new ValidationState("Always invalid"); } }); pM.setMandatory(false); assertEquals("pM.isValid()", true, pM.isValid()); }