public function applyBehaviourOnFormInstance(FormObject $formObject)
    {
        if ($formObject->hasForm()) {
            $formInstance = $formObject->getForm();

            foreach ($formObject->getConfiguration()->getFields() as $fieldName => $field) {
                if (ObjectAccess::isPropertyGettable($formInstance, $fieldName)
                    && ObjectAccess::isPropertySettable($formInstance, $fieldName)
                ) {
                    $propertyValue = ObjectAccess::getProperty($formInstance, $fieldName);

                    foreach ($field->getBehaviours() as $behaviour) {
                        /** @var AbstractBehaviour $behaviourInstance */
                        $behaviourInstance = GeneralUtility::makeInstance($behaviour->getClassName());

                        // Applying the behaviour on the field's value.
                        $propertyValue = $behaviourInstance->applyBehaviour($propertyValue);
                    }

                    ObjectAccess::setProperty($formInstance, $fieldName, $propertyValue);
                }
            }
        }
    }