public static < T > T [ ] append ( Class < T > type , T lhs , T ... rhs ) { T [ ] rs = ( T [ ] ) Array . newInstance ( type , rhs . length + 1 ) ; System . arraycopy ( rhs , 0 , rs , 1 , rhs . length ) ; rs [ 0 ] = lhs ; return rs ; }
Append an element onto an array of unknown type together producing a fresh array whose length equals that of the second plus one .