protected function findAndRemove(EntityInterface $entity = null)
    {
        if (null == $entity) {
            return $entity;
        }

        /** @var EntityInterface $existent */
        foreach ($this->data as $key => $existent) {
            if ($existent->getId() == $entity->getId()) {
                parent::remove($key);
                $this->getEmitter()
                    ->emit(
                        new EntityRemoved(
                            $entity,
                            ['collection' => $this]
                        )
                    );
                break;
            }
        }
        
        return $entity;
    }