public function withQuery(string $query): Uri
    {
        if ($query === $this->query) {
            return clone $this;
        }

        $query = $this->validateQuery($query);

        $new = clone $this;

        $new->query = $query;

        return $new;
    }