code: public static <A> int[] toPrimitiveIntegerArray(A array, NumberArrayAdapter<?, ? super A> adapter) {
      int[] ret = new int[adapter.size(array)];
      for (int i = 0; i < ret.length; i++) {
        ret[i] = adapter.getInteger(array, i);
      }
      return ret;
    }
docs: Convert a numeric array-like to a <code>int[]</code>.
  
  @param array Array-like
  @param adapter Adapter
  @return primitive double array