public static function validate($result, array $context)
    {
        if (!empty($context['parent'])) {
            if (!($result instanceof $context['parent'])) {
                throw new InvalidPointer('Object must be an instance of '.$context['parent']);
            }
        }
        if (!empty($context['validator'])) {
            if (!Callback::call($context['validator'], [$result])) {
                throw new InvalidPointer('Object is not valid');
            }
        }
        return true;
    }