We support primitives

toArray returns an Object[] which may not be casted to primitive array
objects, so we must copy via add()