Returns a collector that accumulates the elements into a new generic array, in encounter order.
the collector implementation