protected function dependencyIsValid($asset, $dependency, $original, $assets)
    {
        if ( ! isset($original[$dependency])) {
            return false;
        }
        else if ($dependency === $asset) {
            throw new SelfDependencyException(sprintf('Asset "%" is dependent on itself.', $asset));
        }
        else if (isset($assets[$dependency]) && in_array($asset, $assets[$dependency]['dependencies'])) {
            throw new CircularDependencyException(sprintf('Assets "%s" and "%s" have a circular dependency.', $asset, $dependency));
        }

        return true;
    }