public static function mergeEntities($targetEntity, $mergeEntity)
    {
        $reflect = new \ReflectionClass($mergeEntity);
        $properties = $reflect->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED);

        foreach ($properties as $property) {

            if (!method_exists($mergeEntity, 'get' . ucfirst($property->getName()))) {
                continue;
            }

            $value = $mergeEntity->{'get' . ucfirst($property->getName())}();

            if (is_a($value, '\\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage')) {
                $targetEntity->{'set' . ucfirst($property->getName())}(new ObjectStorage());
                $singular = (preg_match('~s$~i', $property->getName()) > 0)
                    ? rtrim($property->getName(), 's')
                    : sprintf('%ss', $property->getName());
                foreach ($value->toArray() as $item) {
                    $targetEntity->{'add' . ucfirst($singular)}($item);
                }
            } elseif (!empty(trim($value))) {
                $targetEntity->{'set' . ucfirst($property->getName())}($value);
            }
        }

        return $targetEntity;
    }