public static function validateOptions(array $config)
    {
        if (!isset($config['expected'])) {
            throw new \InvalidArgumentException('expected is required');
        }

        if (!is_callable($config['expected'])) {
            throw new \InvalidArgumentException('expected must be callable');
        }

        if (!isset($config['hash'])) {
            throw new \InvalidArgumentException('hash is required');
        }

        if (!($config['hash']) instanceof HashInterface) {
            throw new \InvalidArgumentException('hash must be an instance of '
                . __NAMESPACE__ . '\\HashInterface');
        }
    }