@SuppressWarnings("unchecked")
	public static <T> T[] toArray(T[] source, Collection<? extends T> newContent) {
		final Object array = Array.newInstance(source.getClass().getComponentType(), newContent.size());
		int i = 0;
		for (final T element : newContent) {
			Array.set(array, i, element);
			++i;
		}
		return (T[]) array;
	}
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] toArray ( T [ ] source , Collection < ? extends T > newContent ) { final Object array = Array . newInstance ( source . getClass ( ) . getComponentType ( ) , newContent . size ( ) ) ; int i = 0 ; for ( final T element : newContent ) { Array . set ( array , i , element ) ; ++ i ; } return ( T [ ] ) array ; }
Convert to an array.

@param <T> the type of the elements.
@param source the original array.
@param newContent the new content.
@return the new array.