public function validateObject($instance)
    {
        if (null !== $this->validator) {
            $violations = $this->validator->validate($instance);

            if (!empty($violations)) {
                throw new ValidationException($violations);
            }
        }
    }