@Test
  @DiagramResource(
      "org/camunda/bpm/modeler/test/ui/change/FormFieldEditAndRemoveChangeSupportTest.bpmn")
  public void testFormFieldPropertyElementRemove() {
    final UserTask userTask = findBusinessObjectById(diagram, "UserTask_1", UserTask.class);

    List<FormDataType> formDataTypeList = ExtensionUtil.getExtensions(userTask, FormDataType.class);
    assertThat(formDataTypeList).hasSize(1);

    EList<FormFieldType> formFieldList = formDataTypeList.get(0).getFormField();
    assertThat(formFieldList).hasSize(1);

    final FormFieldType formFieldType = formFieldList.get(0);
    assertThat(formFieldType).isNotNull();

    assertThat(formFieldType.getProperties().getProperty()).isNotNull();

    AnyNestedChangeFilter filter =
        new AnyNestedChangeFilter(formFieldType, FORM_FIELD_PROPERTIES_FEATURE);
    CustomResourceSetListener listener = new CustomResourceSetListener(formFieldType, filter);
    listener.register();

    transactionalExecute(
        new RecordingCommand(editingDomain) {

          @Override
          protected void doExecute() {
            formFieldType.getProperties().getProperty().remove(0);
          }
        });

    assertThat(listener.getCapturedEvents()).hasSize(1);
  }
  @Test
  @DiagramResource("org/camunda/bpm/modeler/test/ui/change/FormFieldChangeSupportTest.bpmn")
  public void testFormFieldValidationElementAdd() {
    final UserTask userTask = findBusinessObjectById(diagram, "UserTask_1", UserTask.class);

    List<FormDataType> formDataTypeList = ExtensionUtil.getExtensions(userTask, FormDataType.class);
    assertThat(formDataTypeList).hasSize(1);

    EList<FormFieldType> formFieldList = formDataTypeList.get(0).getFormField();
    assertThat(formFieldList).hasSize(1);

    final FormFieldType formFieldType = formFieldList.get(0);
    assertThat(formFieldType).isNotNull();

    assertThat(formFieldType.getValidation()).isNull();

    FeatureChangeFilter filter =
        new FeatureChangeFilter(formFieldType, FORM_FIELD_VALIDATION_FEATURE);
    CustomResourceSetListener listener = new CustomResourceSetListener(formFieldType, filter);
    listener.register();

    transactionalExecute(
        new RecordingCommand(editingDomain) {

          @Override
          protected void doExecute() {
            ValidationType validationType = ModelFactory.eINSTANCE.createValidationType();
            ConstraintType constraintType = ModelFactory.eINSTANCE.createConstraintType();
            constraintType.setName("test");
            constraintType.setConfig("test");

            validationType.getConstraint().add(constraintType);
            formFieldType.setValidation(validationType);
          }
        });

    assertThat(listener.getCapturedEvents()).hasSize(1);
  }