code: private static <K> int objectUnwrap(final Iterator<? extends K> i, final K array[]) {
          int j = array.length, offset = 0;
          while (j-- != 0 && i.hasNext())
              array[offset++] = i.next();
          return array.length - j - 1;
      }
docs: Unwraps an iterator into an array starting at a given offset for a given number of elements.
  <br>This method iterates over the given type-specific iterator and stores the elements returned, up to a maximum of <code>length</code>, in the given array starting at <code>offset</code>. The
  number of actually unwrapped elements is returned (it may be less than <code>max</code> if the iterator emits less than <code>max</code> elements).
  
  @param i     a type-specific iterator.
  @param array an array to contain the output of the iterator.
  @return the number of elements unwrapped.