@ Nonnull @ ReturnsMutableCopy public static < ELEMENTTYPE > ELEMENTTYPE [ ] newArray ( @ Nullable final Collection < ? extends ELEMENTTYPE > aCollection , @ Nonnull final Class < ELEMENTTYPE > aClass ) { ValueEnforcer . notNull ( aClass , "class" ) ; if ( CollectionHelper . isEmpty ( aCollection ) ) return newArray ( aClass , 0 ) ; final ELEMENTTYPE [ ] ret = newArray ( aClass , aCollection . size ( ) ) ; return aCollection . toArray ( ret ) ; }
Create a new array with the elements in the passed collection ..