public function remove(object $entity): self
    {
        $identity = $this->extractIdentity($entity);

        try {
            $state = $this->container->stateFor($identity);

            switch ($state) {
                case State::new():
                    $this->container->push(
                        $identity,
                        $entity,
                        State::removed()
                    );
                    break;

                case State::managed():
                    $this->container->push(
                        $identity,
                        $entity,
                        State::toBeRemoved()
                    );
                    break;
            }
        } catch (IdentityNotManaged $e) {
            //pass
        }

        return $this;
    }