Cache collections do not implement toArray(), so they use the implementation from AbstractCloseableIteratorCollection, which calls first collection.size(), creates an array with the appropriate size, and then populates the array from the iterator.
Calling stream().toArray() avoids the size() call, so they should also implement toArray() and use stream.toArray() internally.