public E[] toArray(E[] a){
  if (a.length != array.length()) {
    throw new ElasticsearchGenerationException("AtomicArrays can only be copied to arrays of the same size");
  }
  for (int i=0; i < array.length(); i++) {
    a[i]=array.get(i);
  }
  return a;
}

public E [ ] toArray ( E [ ] a ) { if ( a . length != array . length ( ) ) { throw new ElasticsearchGenerationException ( "AtomicArrays can only be copied to arrays of the same size" ) ; } for ( int i = 0 ; i < array . length ( ) ; i ++ ) { a [ i ] = array . get ( i ) ; } return a ; }
copies the content of the underlying atomic array to a normal one .
