docs: 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;
    }