public function validate(array &$data, Validation &$validation = null) {
        if (!$this->isValidInternal($data, $this->schema, $validation, '')) {
            if ($validation === null) {
                // Although this should never be null, scrutinizer complains that it might be.
                $validation = new Validation();
            }

            throw new ValidationException($validation);
        }
        return $this;
    }