public static <T>T[] toMultiElementArray(int count,T value){
  T[] array=(T[])Array.newInstance(value.getClass(),count);
  for (int i=0; i < count; i++) {
    array[i]=value;
  }
  return array;
}

public static < T > T [ ] toMultiElementArray ( int count , T value ) { T [ ] array = ( T [ ] ) Array . newInstance ( value . getClass ( ) , count ) ; for ( int i = 0 ; i < count ; i ++ ) { array [ i ] = value ; } return array ; }
creates an explicitly sized array of generic type t , containing the given value for all its elements . example : tomultielementarray ( 2 , true ) ; = > boolean [ ] array = new boolean [ 2 ] { true , true } ;
