public function remove($key)
    {
        $pair = $this->repository->find($key);
        if ($pair !== null) {
            $this->repository->remove($pair->getId());
            $this->manager->flush();
            $this->manager->refresh();
        }
    }