public function remove($object, $flush = true)
    {
        $this->isExpectedObject($object);
        $this->objectManager->remove($object);
        if ($flush) {
            $this->flush();
        }
    }