Transfers elements that match the predicate into the selected toArray. The elements will be removed from this array and added toArray.