$page->url() language + params

I found out i can pass parameters with the url() method like so:

$page->url(["params" => ["test" => "cool"]]);

This function is very useful (and not documented as far as i can see) but how can i get and url with params and a different language ? I tried the following without success:

$page->url("it", ["params" => ["test" => "cool"]]);
$page->url(["params" => ["test" => "cool"]], "it");
$page->url(["params" => ["test" => "cool"], "language" => "it"]);
$page->url(["params" => ["test" => "cool"], "lang" => "it"]);
$page->url(["params" => ["test" => "cool"], "locale" => "it"]);

Ok, i found out that $page->urlForLanguage() is the correct way to do what i want

If you pass an array of options, you have to pass to language in the array:

$page->url([
  'language' => 'it',
  "params" => ["test" => "cool"],
]);

That does not work, you must use urlForLanguage