protected function isRequireAssociation(array $mapping)
    {
        $ref = new \ReflectionClass($mapping['sourceEntity']);

        if (\in_array(RoleHierarchicalInterface::class, $ref->getInterfaceNames(), true)
                && 'children' === $mapping['fieldName']) {
            return true;
        }

        if (\in_array(GroupableInterface::class, $ref->getInterfaceNames(), true)
                && 'groups' === $mapping['fieldName']) {
            return true;
        }

        return false;
    }