add method ArrayList::toArray()