Updated JavaDoc to reflect toArray's contract