@SuppressWarnings("unchecked")
	default <B> B[] toArray(final B[] array) {
		if (array.length < length()) {
			final Object[] copy = (Object[])java.lang.reflect.Array
				.newInstance(array.getClass().getComponentType(), length());

			for (int i = length(); --i >= 0;) {
				copy[i] = get(i);
			}

			return (B[])copy;
		}

		for (int i = 0, n = length(); i < n; ++i) {
			((Object[])array)[i] = get(i);
		}
		if (array.length > length()) {
			array[length()] = null;
		}

		return array;
	}
Return an array containing all of the elements in this sequence in right
order; the runtime type of the returned array is that of the specified
array. If this sequence fits in the specified array, it is returned
therein. Otherwise, a new array is allocated with the runtime type of the
specified array and the length of this array.
<p>
If this sequence fits in the specified array with room to spare (i.e.,
the array has more elements than this array); the element in the array
immediately following the end of this array is set to null. (This is
useful in determining the length of the array only if the caller knows
that the list does not contain any null elements.)

@see java.util.Collection#toArray(Object[])

@param <B> the runtime type of the array to contain the sequence
@param array the array into which the elements of this array are to be
        stored, if it is big enough; otherwise, a new array of the same
        runtime type is allocated for this purpose.
@return an array containing the elements of this array
@throws ArrayStoreException if the runtime type of the specified array is
        not a super type of the runtime type of every element in this
        array
@throws NullPointerException if the given {@code array} is {@code null}.
jenetics/src/main/java/io/jenetics/util/Seq.java