public static < T > T [ ] toArray ( Collection < T > col , Class < T > cls ) { T [ ] arr = ( T [ ] ) Array . newInstance ( cls , col . size ( ) ) ; return col . toArray ( arr ) ; }
Converts Collection to array .