public static function convert(array $json)
    {
        $loader  = new ArrayLoader;
        $package = $loader->load($json);


        if ($package instanceof CompletePackage) {
            return $package;
        }

        // @codeCoverageIgnoreStart
        throw new InvalidPackageException(
            'Expected instance of CompletePackage, got '.get_class($package)
        );
        // @codeCoverageIgnoreEnd
    }