protected function _setFactory($factory)
    {
        if ($factory !== null && !($factory instanceof FactoryInterface)) {
            throw $this->_createInvalidArgumentException(
                $this->__('Argument is not a valid factory instance'),
                null,
                null,
                $factory
            );
        }
        $this->factory = $factory;
    }