public static <A> double[] toPrimitiveDoubleArray(A data, NumberArrayAdapter<?, A> adapter) {
    if(adapter == DoubleArrayAdapter.STATIC) {
      return ((double[]) data).clone();
    }
    final int len = adapter.size(data);
    double[] x = new double[len];
    for(int i = 0; i < len; i++) {
      x[i] = adapter.getDouble(data, i);
    }
    return x;
  }
public static < A > double [ ] toPrimitiveDoubleArray ( A data , NumberArrayAdapter < ? , A > adapter ) { if ( adapter == DoubleArrayAdapter . STATIC ) { return ( ( double [ ] ) data ) . clone ( ) ; } final int len = adapter . size ( data ) ; double [ ] x = new double [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { x [ i ] = adapter . getDouble ( data , i ) ; } return x ; }
Local copy, see ArrayLikeUtil.toPrimitiveDoubleArray.

@param data Data
@param adapter Adapter
@return Copy of the data, as {@code double[]}