Relates :
|
AbstractCollection.toArray calls hasNext() and next() in a loop, but the hasNext() calls are unnecessary since the number of elements is known ahead of time, since size() has already been called. We should provide the same optimization already used in toArray(T[]).
|