private function setItemClass($class)
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException(
                sprintf('Item class %s does not exist', $class)
            );
        }

        $interfaces = class_implements($class, true);

        if (!in_array(ItemInterface::class, $interfaces)) {
            throw new InvalidArgumentException(sprintf(
                'Item class %s must inherit from %s',
                $class,
                ItemInterface::class
            ));
        }

        $this->itemClass = $class;
    }