public function remove($entity)
    {
        $idAccessorRegistry = $this->unitOfWork->getEntityRegistry()->getIdAccessorRegistry();
        $entityId           = $idAccessorRegistry->getEntityId($entity);

        $this->updateMap();

        if (!in_array($entityId, $this->map)) {
            throw new EntityNotFoundException;
        }

        $colJoinName = $this->relation->colJoinName();
        $mapObject   = $this->mapRepository->findOne()->with($colJoinName, Operator::EQUAL, $entityId)->getItem();
        $this->mapRepository->remove($mapObject);
        $this->map = array_diff($this->map, [$entityId]);
    }