@Test
public void setRequired() {

    AbstractFormItem<String> formItem = formItem(false);
    formItem.setRequired(true);
    verify(readOnlyAppearance).apply(REQUIRED, null);
    verify(editingAppearance).apply(REQUIRED, null);
    reset(readOnlyAppearance, editingAppearance);
    formItem.setRequired(false);
    verify(readOnlyAppearance).unapply(REQUIRED);
    verify(editingAppearance).unapply(REQUIRED);
}