public static function create(string $type): \Menu\Type\TypeInterface
    {
        if (empty($type)) {
            throw new InvalidArgumentException('Type must be a non-empty string.');
        }

        $className = __NAMESPACE__ . '\\Types\\' . Inflector::camelize($type);
        if (!class_exists($className)) {
            throw new RuntimeException('Class [' . $className . '] does not exist.');
        }

        $interface = __NAMESPACE__ . '\\' . static::INTERFACE_CLASS;
        if (!in_array($interface, class_implements($className))) {
            throw new RuntimeException('Class [' . $className . '] must implement [' . $interface . '] interface.');
        }

        return new $className();
    }